search speed

Stefan Behnel stefan_ml at behnel.de
Fri Jan 30 21:51:28 CET 2009


Diez B. Roggisch wrote:
> that's not necessarily the best thing to do if things have a
> record-like structure. The canonical answer to this is then to use a
> database to hold the data, instead of flat files. So if you have any
> chance to do that, you should try & stuff things in there.

It's worth mentioning to the OP that Python has a couple of database
libraries in the stdlib, notably simple things like the various dbm
flavoured modules (see the anydbm module) that provide fast
string-to-string hash mappings (which might well be enough in this case),
but also a pretty powerful SQL database called sqlite3 which allows much
more complex (and complicated) ways to find the needle in the haystack.

http://docs.python.org/library/persistence.html

Stefan



More information about the Python-list mailing list