Tim Bunce wrote:
> 
> On Thu, Mar 21, 2002 at 12:17:20AM -0500, Jerrad Pierce wrote:
> >
> > No word or progress? I independently arrived at the some conlusion myself,
> > but have yet to get around to doing it. Perhaps next week if you don't
> > know of any pre-existing work, a good intro to DBM.
> 
> These days I'd think in terms of extending DBD::AnyData, certainly you'd
> want to use SQL::Statement.

I did actually start a DBD::AnyData extension for DBM but would love for
someone else to take it over.

Getting it to work as a DBD is not the problem. The trick is to use the
optimization provided by DBM keys. If one is searching only on the key
field, then why use SQL?  And if one is searching on multiple fields,
then one needs to either grab everything from the DBM file and parse
through each line (in which case one loses the advantage of the keys) or
one needs to do two passes - first get all records that match the key
field (quick) and then parse through that set matching the other fields
(slow).

I have a working extension for Storable which would be a good basis to
extend for DBM.  It uses a combination of clear text and "frozen" fields
so the search on the text fields can be fairly rapid and the frozen
fields only thawed for matched records.  (This also allows the use of
Perl objects as BLOBS)

Or you can work directly from SQL::Statement.  In either case, I'd be
glad to help.

-- 
Jeff
(author of DBD::AnyData and of the perl version of SQL::Statement)

Reply via email to