persistent dictionary with non-string keys

Larry Bates lbates at swamisoft.com
Wed Jul 7 16:20:30 EDT 2004


Can't you just create indexes on the items that you
use as dictionary keys in the MySQL database and
look them up as you need them (MySQL is blazingly
fast reading indexed data)?  You could create
a dictionary-like class wrapper around the SQL
access so that it "looks" like a regular dictionary
to main program.  You could also cache information
in this class, if data access is such that caching
would speed up entries that are frequently accessed.

If not, you may want to take a look at Gadfly:

http://gadfly.sourceforge.net/gadfly.html

HTH,
Larry Bates
Syscon, Inc.

"San71" <jhmsmits at xs4all.nl> wrote in message
news:97831683.0407071139.5bdbd65 at posting.google.com...
> I'm writing an application which creates a rather large dictionary (>
> 500 MB) from MySQL data. It is a dictionary which uses integers,
> tuples, and datetime instances as keys. I've tried shelve (str() en
> eval() for the integer and tuples), but of course, that doesn't solve
> it, because I also need to keep the datetime instances intact as a
> key. Is there a way to make this dictionary persistent?





More information about the Python-list mailing list