472,353 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Flat DB seeking speed

Hello all

I see there are lots of flat db or db-like modules in the standard
python modules.
What about the keywords seeking speed of them ?

(I want to put about 10000 articles with 10000 IDs, and I can do
searching keywords with them)

The db-like modules are :
dbm, gdbm, dbhash,anydbm,
pickle(cPickle), shelve, marshal

Any advice? Thank you.

Jia Lu

Apr 22 '07 #1
3 2538
Jia Lu <Ro*****@gmail.comwrote:
Hello all

I see there are lots of flat db or db-like modules in the standard
python modules.
What about the keywords seeking speed of them ?

(I want to put about 10000 articles with 10000 IDs, and I can do
searching keywords with them)

The db-like modules are :
dbm, gdbm, dbhash,anydbm,
pickle(cPickle), shelve, marshal
Your question is somewhat hard to parse (I sympathize, since English
isn't my mother-tongue, either) -- "keywords seeking speed" is very hard
to understand in this context.

Marshal and pickle/cPickle aren't "db-like" at all -- they're just
sequences of serialized objects; marshal is low-level (you can only
serialize objects of some fundamental built-in types), pickle (and the
faster cPickle) higher-level (you can serialize objects of many
different types), but in either case there is no "seeking", "keywords"
or otherwise, just sequential reloading of the objects you serialized.
Handy when that's what you need -- persist a bunch of objects to a disk
file, rebuild them in memory later -- but it doesn't appear to have much
to do with anything in your question and I'm really perplexed as to why
you think it might (what materials did you use to study these subjects,
that gave you such a horrendously wrong impression?!).

All forms of dbm files (including the implementation known as gdbm, as
well as the lookalike one built on top of bsddb), as well as bsddb
(which you don't even mention), represent on disk a map from "key"
strings to "value" strings. shelve is a modest extension to this
concept: it maps from "key" strings to arbitrary picklable objects
(using cPickle to map such objects to and from strings of bytes).
anydbm is a very thin layer on top of various dbm implementation (it
uses whichdbm to make an informed guess as to what kind of dbm module
was used to make a given dbm-like file, and also uses the best dbm
implementation you have installed to build a new file of some dbm type).

If by "keywords seeking" you mean performing full-text search, none of
these modules are at all suitable. Perhaps you might want to try
pylucene, <http://pylucene.osafoundation.org/>, or other such
third-party modules, for the purpose -- it that IS indeed your purpose.
Alex
Apr 22 '07 #2
Jia Lu skribis:
Hello all

I see there are lots of flat db or db-like modules in the standard
python modules.
What about the keywords seeking speed of them ?

(I want to put about 10000 articles with 10000 IDs, and I can do
searching keywords with them)

The db-like modules are :
dbm, gdbm, dbhash,anydbm,
pickle(cPickle), shelve, marshal

Any advice? Thank you.
If you need near DB quality, you should give buzhug a look:

it is pure python:

http://buzhug.sourceforge.net/

Apr 22 '07 #3
In article <11*********************@o5g2000hsb.googlegroups.c om>,
Jia Lu <Ro*****@gmail.comwrote:
>
I see there are lots of flat db or db-like modules in the standard
python modules.
What about the keywords seeking speed of them ?

(I want to put about 10000 articles with 10000 IDs, and I can do
searching keywords with them)

The db-like modules are :
dbm, gdbm, dbhash,anydbm,
pickle(cPickle), shelve, marshal
Another option would be to use a real database, such as SQLite. Then you
could easily create an inverted index with your keywords. This is a good
alternative to full-text indexing when you otherwise want DB capabilities
(such as for storing other information with your articles).
--
Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/

Help a hearing-impaired person: http://rule6.info/hearing.html
Apr 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo...
3
by: I.V. Aprameya Rao | last post by:
Hi I have to implement a flat file dbms. The basic condition is that relations will be given in files and i will have to run certain select...
3
by: Jim Hubbard | last post by:
My own searches have proven to be of little help in understanding the implementation of this technology (available since Win98). Any information...
12
by: Karlo Lozovina | last post by:
I've been Googling around for _small_, flat file (no server processes), SQL-like database which can be easily access from Python. Speed and...
28
by: MLH | last post by:
Would like to roll out something in Access 2.0 to read MAC address on 16-bit systems. Have resolved on 32-bit platforms but still need help with...
2
by: Frank | last post by:
Hello all, I have to access a flat file (.txt or something) by two applications at the same time. For reading and writing. Is that possible and...
6
by: akapsycho | last post by:
I'm already using MySQL for most of my site but I just need a simple, non-dynamic log of every user's page visits while logged in to my site. My main...
9
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hello I am developing a system for user tracking. In this I am tracking all the visitors that came to my website. i developed this using a...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1....
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.