which db should I use?

Alex Martelli aleax at aleax.it
Mon May 13 06:04:50 EDT 2002


Jim Richardson wrote:
        ...
>> Why not just store them as files in the file system?
> 
> searches are really slow with grep, on an ext3 filesystem. I wouldn't
> mind a file based system, but will probably go with a db system in order
> to learn more about SQL

grep and SQL have little in common.  You can use regular expressions
in PostgreSQL, but that's a definitely *non-standard* extension to SQL!
Besides, I doubt performance would be dramatically enhances as long as
your searches are RE-based anyway, as they'd have to scan everything in
any case, no matter where you store the "everything".

You could build a fulltext-index for your data -- THAT can give you
huge performance advantages, and if the index is large enough then it
may well be worthwhile to keep *the index* as a relational database.

However, try first the classic two-scripts, 20-lines Python approach
with module shelve as the residence of your index, so you can work
out the kinks, find out limitations, etc, in a friendlier and more
plastic environment.  I'm pretty sure you can find good examples of
that approach everywhere, though a good one is in my Linux Magazine
article, April issue (thus not online yet, I think).


Alex




More information about the Python-list mailing list