469,936 Members | 2,463 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

persistent dictionary with non-string keys

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?
Jul 18 '05 #1
1 1449
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" <jh******@xs4all.nl> wrote in message
news:97*************************@posting.google.co m...
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?

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Randell D. | last post: by
16 posts views Thread by Paul Rubin | last post: by
1 post views Thread by hochun | last post: by
6 posts views Thread by David Rasmussen | last post: by
8 posts views Thread by bashful.belle | last post: by
3 posts views Thread by sanchita | last post: by
4 posts views Thread by GaryDean | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.