473,734 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2632
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.osafou ndation.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************ *********@o5g20 00hsb.googlegro ups.com>,
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**@pythoncra ft.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
3929
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 them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
3
2282
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 someone tell me as to which language will be faster, python or C++?? Aprameya
3
2090
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 Layer (DDML) usage would be greatly appreciated. Jim Hubbard
12
3746
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 data is contained within single file and no server binary has to run in order to use the dbase. Oh, and I'm using Python under Cygwin. Ofcourse, ease of use and simplicity is most welcomed :). I'm currently playing around SQLite+PySQLite and...
28
2206
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
2161
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
1388
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 server speed and the speed of other MySQL requests and the increased load on the processor. I haven't tried to do this either way but read a pretty comprehensive tutorial on a flat file log system. These logs could just be downloaded on to my hard...
9
1890
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 database. Everything worked fine till my website gets good traffic. When website is getting good traffic, this method is slowing down the entire application. So I am planning to use flat files instead of SQL Server database. My doubts are
15
5275
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 show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.