473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2611
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 gallery. An upload form, to upload the photos and give...
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 project join queries on those relations. Can...
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 that you could share on Display Driver Management...
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 perforamnce are of no issue, most important is that all...
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 Access Basic code to do it from within Access 2.0.
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 how? Thanks Frank
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 concerns are disk space, the potential impact on...
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 HTTPModule and storing the data in a SQL Server...
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. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.