Hi

I'm currently developing a package manager (for linux) (yes I know, yet 
another, useless...) and I'm using XML files for the database. But the 
problem of that way is the slowdown and the memory cost of xml files + XPath 
query
So I'm exploring other ways to store the database.
The first other way I want to try is sqlite, because it has perfect bindings 
for python (my favorite scripting language) allowing the quick creation (less 
than one hour, including tests, RTFM...) of a convertion tool XML => sqlite
After the convertion, I get a 8,6MB database, with a table files containing 
about 140000 records, a packages table with about 440 records...
The draft of the database is here (a picture showing the relations between 
tables) : http://pinaraf.robertlan.eu.org/schemadb.png (you'll notice some 
differences)
I'm trying some "simple" query. The first query is "Whose file is it ?"
Here is my first SQL query for that (ran with the sqlite3 command) :
sqlite> SELECT p.name FROM packages p, files f WHERE f.pkgid=p.pkgid AND 
f.filename="/usr/bin/gcc";
gcc-core

But it took about 1 minute to give the answer, while the following query took 
less than one second :
sqlite> SELECT name FROM packages WHERE pkgid = (SELECT pkgid FROM files WHERE 
filename="/usr/bin/gcc");
gcc-core


Is it a known bug of sqlite ? Did I do something wrong ?
You can get the database here : 
http://pinaraf.robertlan.eu.org/database.db.bz2 (1,4MB compressed file)
I'm using sqlite 3.2.1, from ubuntu (breezy) packages...


Thanks for reading me...

Reply via email to