[comp.lang.c] Btree library

marmor@bimacs.BITNET (Eli Marmor) (05/26/89)

Hi Btree experts in the net. I need your collective expertise on the
following problem:
We have a complicated program (for PC) which uses Btrieve. We are porting it
to other OS's and machines, so we have to emulate Btrieve by
another database library source (in C), because the original one was written
in Assembly (8086).

I've heard about the following:
        D-isam  -  C-isam compatible source.
        C-tree  -  Another Btree source.
        db_vista -   "       "     ".
        B-Plus  -  A Public-Domain source.

Currently, I have only the 4th, so I can't check which of them is the most
appropriate for emulating Btrieve. I can't test performance, too.

I would like to get the net impression, on my problem.
If there are any benchmarks, I will be glad to hear about them.
The important criterions are:
        applicability
        which is optimised for this purpose
        performance
        portability (Dos, Unix)
If there is another software, I'll be happy to hear about it.

Please E-mail replies. I will summerize if interest arises. Thanks in
advance.  Eli.

    Eli Marmor.
    El-Mar.
    7 Lassale st., Kfar-Saba, Israel 44417
    Tel: (972-52) 929556

    BITNET: marmor@bimacs
    ARPA:   marmor%bimacs.bitnet@cunyvm.cuny.edu
    CSNET:  marmor%bimacs.bitnet%cunyvm.cuny.edu@csnet-relay
    UUCP:   uunet!mcvax!humus!bimacs!marmor

kevin@kosman.UUCP (Kevin O'Gorman) (05/29/89)

In article <868@bimacs.BITNET> marmor@bimacs.BITNET (Eli Marmor) writes:
>
>to other OS's and machines, so we have to emulate Btrieve by
>another database library source (in C), because the original one was written
>in Assembly (8086).
>
>If there is another software, I'll be happy to hear about it.
>
>Please E-mail replies. I will summerize if interest arises. Thanks in

Sorry, e-mail from here to a bitnet address is totally hopeless.

You might want to check out the C/Database Toolchest (a modified B+tree
implementation, with C sources).  It comes for a very low price (around
$US 20) and includes a bound manual of 365 pages.

Contact Mix Software Inc.,1132 Commerce Dr, Richardson, TX 75081.
1-800-333-0330.

I have purchased this thing myself, but have not had a chance to look
over the quality of results.  The packaging and source code style are
pretty impressive.  For the price, it may be worth just getting it.
That's how I felt.

marmor@bimacs.BITNET (Eli Marmor) (05/31/89)

I wrote:

>Hi Btree experts in the net. I need your collective expertise on the
>following problem:
>We have a complicated program (for PC) which uses Btrieve. We are porting it
>to other OS's and machines, so we have to emulate Btrieve by
>another database library source (in C), because the original one was written
>in Assembly (8086).
>
>I've heard about the following:
>       D-isam  -  C-isam compatible source.
>       C-tree  -  Another Btree source.
>       db_vista -   "       "     ".
>       B-Plus  -  A Public-Domain source.
>
>Currently, I have only the 4th, so I can't check which of them is the most
>appropriate for emulating Btrieve. I can't test performance, too.
>
>
>I would like to get the net impression, on my problem.
>If there are any benchmarks, I will be glad to hear about them.
>The important criterions are:
>       applicability
>       which is optimised for this purpose
>       performance
>       portability (Dos, Unix)
>If there is another software, I'll be happy to hear about it.


                PART 1: B-Plus
                ==============

First of all, I want to refer to B-Plus, because I recieved many questions
about it. It isn't public domain, and I meant to say it was shareware.
I want to quote a part from its documentation:

>              B-PLUS is a versatile, carefully designed module for C
>         programmers who need a fast, efficient program for indexing
>         data files.  B-PLUS allows data records to be retrieved based
>         on a key value without regard to their position in the data
>         file.  The data records can also be accessed in sequential
>         order in either a forward and reverse direction.
>
>              The B-PLUS Program Module is based on the famous and
>         widely used b-tree algorithm and has a number of useful
>         extensions which are not found in many programs of this type.
>         Some of its features are the following:
>
>              - Variable length keys are allowed
>              - File size limited only by DOS or by disk space
>              - All functions are non-recursive so very little stackO
>                space is required
>              - The most recently used key values are stored in a
>                cache buffer in main memory for fast access
>              - Duplicate keys are allowed
>
>              The B-PLUS program has been tested using the Microsoft C
>         Compiler, Versions 4.0 and 5.0 (Beta), and the Borland Turbo
>         C Compiler Version 1.0.  The compiled object file is less
>         than 9.4K bytes in length for these compilers.
>
>
>         LICENSE AND REGISTRATION
>
>              B-PLUS is distributed as a "shareware" program.  Please
>         help us get it known by giving unmodified copies of the
>         program and documentation to other programmers who may find
>         B-PLUS useful.
>
>              B-PLUS is copyright (C) 1987 by Hunter and Associates.
>         It is not public domain or free software.  Non-registered
>         users are granted a limited license to use B-PLUS on a trial
>         basis for determining whether or not it is suitable for their
>         needs.  Registration permits the use of B-PLUS on one CPU and
>         allows the use of the compiled B-PLUS modules in programs for
>         general sale and/or distribution.
>
>              The registration fee is $25 or $35.  Users who pay the
>         $35 fee will be sent a disk containing a fully commented
>         listing of the latest source code, the user documentation,
>         and a number of useful sample programs.  Users who pay the
>         $25 fee are not sent a new disk but are included in the
>         mailing list for announcements about both current and future
>         products.  Your prompt registration of your copy of the B-
>         PLUS program is appreciated.
>
>              A trial disk with supporting documentation is available
>         directly from Hunter and Associates for $10.
>
>              Register your usage of B-PLUS by sending the registra-
>         tion fee to:
>
>                        Hunter and Associates
>                        7050 NW Zinfandel Lane
>                        Corvallis, OR  97330
>                        Telephone: (503) 745-7186
>
>         Your comments regarding the B-PLUS program or any suggestions
>         you have for extensions or for other programs that would be
>         useful to you are welcomed.
>
>              Hunter and Associates makes no warranties whatsoever
>         regarding the B-PLUS computer programs or the supporting
>         documentation.

As shareware, it's very useful, but I think it can't compete with
the others I mentioned: C-ISAM, c-tree, Btrieve.


                PART 2: Btrieve
                ===============

I meant to Novell Btrieve. It's a resident library for PC's, and
because it was written in Assembly, it can't be ported to other machines,
so I have to use an another file-handler (with source) to emulate it.
It's too good, so it won't be so easy to emulate.


                PART 3: D-ISAM & c-tree
                =======================

D-ISAM is a C-ISAM compatible, that is sold with source code.
It's sold by a Canadian software house, called BYTE Designs
(authors of 'w' - windows for C).
C-ISAM is the Informix file's format, and the standard of X/OPEN for
UNIX DBMSs.
c-tree is the most popular file handler for UNIX, and is sold
(with its source code) by FairCom (4006 West Broadway, Columbia,
MO 65203).
I have a DEPENDENT benchmark from FairCom. They claim:

>                       Btrieve V4.00   C-ISAM V2.11    c-tree V4.1
>                       =============   ============    ===========
>Add Record (seconds):   0.54           0.45            0.35
>Delete "  :             0.86           1.07            0.41
>Update " with key cha': 0.91           0.87            0.46
>Random search:          0.17           0.14            0.11
>File Size (in MB):      2.00           1.77            1.71
>
>Variable Length Record: V              X               V
>  "        "    Keys:   V              V
>  "  Key Segment offs': X              X               V
>Key Compression:        X              V               V
>Virtual File Opens:     V              X               V
>Partial Key Search:     X              V               V
>Maximum Indices:        24             Unlimited       Unlimited
>Max' Segments per Key:  24             8               Unlimited
>Integer Key Type:       V              V               V
>Floating Point Key T':  X              V               V
>Decimal Key Type:       X              V               X
>Maximum Key Length:     255            120             255
>Alt' Collating Sequence:V              V               V
>Change File Buf' Conf': V              X               V
>Transaction Processing: V              X               X
>Multi-User/Netw' Supp': Optional       Optional        V
>Source Code:            X              $10,000~        V
>No Royalties:           V              X               V
>Distribute Utilities:   X              X               V
>Free Updates:           X              X               V
>Free Mfctrer's Support: X              V               V

I'm very doubtful regarding the performance, because it's a dependent
benchmark, and everybody claims he's faster, wiser, etc.
With regard to the other capabilities, I know that the new versions
of them filled in what was missing, but D-ISAM is compatible with the
old version mentioned here.
Of course, as opposed to C-ISAM, D-ISAM has no royalties and its
source-code is included in based price, like c-tree.

This benchmark, except for dependence, doesn't help me know
which of them is the easier to be changed or to emulate Btrieve.
Thus, I need your help in these problems.

Please E-mail replies. I will summerize if interest arises. Thanks in
advance.  Eli.

    Eli Marmor.
    El-Mar.
    7 Lassale st., Kfar-Saba, Israel 44417
    Tel: (972-52) 929556

    BITNET: marmor@bimacs
    ARPA:   marmor%bimacs.bitnet@cunyvm.cuny.edu
    CSNET:  marmor%bimacs.bitnet%cunyvm.cuny.edu@csnet-relay
    UUCP:   uunet!mcvax!humus!bimacs!marmor

davidsen@sungod.crd.ge.com (William Davidsen) (06/01/89)

Someone suggested that you use Bplus shareware. If so, get a copy which
has my portability patches (sent to comp.sources.unix months ago but not
posted yet). This allows running on UNIX and other machines which are
not PC compatible.

I make no claims on my changes, any shareware fees are still due Hunter
and Associates.
	bill davidsen		(davidsen@crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

conan@vax1.acs.udel.EDU (Robert B Carroll) (06/02/89)

I've used ctree for faircom. I used it on records
with over 50 fields and something like 14 keys.
it worked pretty good and fast. Biut this was on a mini
computer with lotto ram and fast disks.
faircom makes a companion report generator called
r-tree. i didn't get a chance to use that.
oh yeah, the manuals have many pages.
-- 
conan@vax1.acs.udel.edu OR conan@192.5.57.1
CONAN THE BARBARIAN of Cimmeria

awd@dbase.UUCP (Alastair Dallas) (06/03/89)

Email doesn't work for me.  Sorry.  My fault.

Just wanted to mention that db_vista, last I looked, was a network model
database, not B-Tree.  Also to point you at PC Tech Journal, Vol 3, No. 3,
March, 1985 and the article beginning on page 131 by Atindra Chaturvedi
which includes source to a straightforward B-Tree implementation.

In addition, several libraries offer B-Trees among other things: PforCe,
by Phoenix, for instance.  I like PforCe, and it does a lot more than
indexes; it comes with source code, too.

Good luck.

/alastair/

Disclaimer: My employer and I don't share thoughts like this often.
Whatever that means.

bob@consult.UUCP (Bob Willey) (06/04/89)

In article <870@bimacs.BITNET> marmor@bimacs.BITNET (Eli Marmor) writes:
>>We have a complicated program (for PC) which uses Btrieve. We are porting it
>>to other OS's and machines, so we have to emulate Btrieve by
>>another database library source (in C), because the original one was written
>>in Assembly (8086).


The obvious answer seems to be to use the Novell BTreive module for the 
operating system you are using.  It is available in several environments
such as SCO Xenix and DOS and networking.  Several others that we do not
use ourselves.

-- 
.. Computer Consulting Service     ..      Bob Willey        ..
.. P.O. Drawer 1690                ..    uunet!consult!bob   ..
.. Easton, Maryland  21601         ..    (301) 820-4670      ..
...............................................................

marmor@bimacs.BITNET (Eli Marmor) (06/07/89)

In article <32@consult.UUCP> bob@consult.UUCP (Bob Willey) writes:

>In article <870@bimacs.BITNET> marmor@bimacs.BITNET (Eli Marmor) writes:

>>We have a complicated program (for PC) which uses Btrieve. We are porting it
>>to other OS's and machines, so we have to emulate Btrieve by
>>another database library source (in C), because the original one was written
>>in Assembly (8086).
>
>
>The obvious answer seems to be to use the Novell BTreive module for the
>operating system you are using.  It is available in several environments
>such as SCO Xenix and DOS and networking.  Several others that we do not
>use ourselves.

The language in which BTrieve was written (8086 Assembly) doesn't prevent
it from running on another OS, ON INTEL MACHINES of course !!!
Novell has a version for Xenix, but ONLY for 80X86 family.
There is no version for other machines, because Assembly is not portable.

        Thanks. I'm waiting for more answers.
                                Eli Marmor

phoenix@ms.uky.edu (R'ykandar Korra'ti) (06/08/89)

In article <883@bimacs.BITNET> marmor@bimacs.BITNET (Eli Marmor) writes:
>The language in which BTrieve was written (8086 Assembly) doesn't prevent
>it from running on another OS, ON INTEL MACHINES of course !!!
>Novell has a version for Xenix, but ONLY for 80X86 family.
>There is no version for other machines, because Assembly is not portable.
>                                                ^^^^^^^^^^^^^^^^^^^^^^^^
     If you're willing to do a little work, you could convert the machine
back into assembly, alter it a bit as needed, then cross-assemble to another
machine's machine code. (These are called cross-compilers; the utilities
that convert the machine code to assembly are called disassemblers.)
     All this assumes that you have the rights to mess with BTrieve, of
course.
                                                     - R'ykandar.

-- 
| "Signature V1.2.1.2..." | phoenix@ms.uky.edu | phoenix@ukma.bitnet |
| "Got enough addresses, bub?" | CIS 72406,370 | PLink: Skywise      |
| "Alms! Alms! Laser printers for the poor!"   | QLink: Bearclaw     |

mark@intek01.UUCP (Mark McWiggins) (06/10/89)

In article <883@bimacs.BITNET>, marmor@bimacs.BITNET (Eli Marmor) writes:
> >>We have a complicated program (for PC) which uses Btrieve. We are porting it
> >>to other OS's and machines, so we have to emulate Btrieve by
> >>another database library source (in C), because the original one was written
> >>in Assembly (8086).
> >
> >
Bob Willey:
> >The obvious answer seems to be to use the Novell BTreive module for the
> >operating system you are using.  It is available in several environments
> >such as SCO Xenix and DOS and networking.  Several others that we do not
> >use ourselves.


Forget Btrieve on anything but DOS.  We found the Xenix version to be
very unreliable, and Softcraft to be very uninterested in fixing it.

We switched to C-tree for Unix (and the Macintosh) with great success.
You also get source, which has saved our cookies more than once.

Good luck.  It's a database jungle out there. :)

Mark McWiggins
Integration Technologies, Inc. (Intek)
(206) 455-9935
uunet!intek01!mark