[pacman-dev] [PATCH] Database with index??

JJDaNiMoTh jjdanimoth at gmail.com
Sat Dec 8 17:21:40 EST 2007


Hello to all.

After 2 weeks of intensive work (:P) I'm glad to post the first
proof-of-concept code about using index in our life. Do you remember
the discussion Backend DB, where we talked about in November? If not,
see
http://archlinux.org/pipermail/pacman-dev/2007-November/009938.html :
Mikos proposed to see how pacman works with a big database file, like
pacman1, but with a smaller index, that contains some information
( like pkgname - pkgver ) and where an entries start and finish in the
big database. 

So, I've thinked about the making of index every time that users do
pacman -Sy; but we haven't time to re-make index all times; so, I've
coded all on the "B-side" of pacman: repo-add.

The result are two file:
txtdb.idx ===> big, big database file;
index.idx ===> smaller file, that has this format:
pkgname - pkgver - line_start - line_end

Example:
chpax - 0.12 - 22 - 53

Reading the line that contains "chpax", I see that the entries in
txtdb.idx starts on line 22 and ends on line 53. Note that this patch
doesn't modify the old way to make database. It simply add a new one :D

Now the only part that I need to code is the pacman-side.
Why I haven't coded this yet?
Because pacman-side is ( in my point of view ) the more difficult part,
and ( last but no last ) I want to hear your opinion about this.

Excuse my elementary english ( I have rewrited 3 times the introduction
to the patch :D ) and excuse If I can't explain how patch works ( I
don't write any comments.. ). I will do all ( comments and explain )
tomorrow.. now it's very late :)

Thanks

-- 
JJDaNiMoTh - ArchLinux Trusted User
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-a-big-database-file-and-an-index.patch
Type: application/octet-stream
Size: 6179 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20071208/f38416f8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20071208/f38416f8/attachment.pgp>


More information about the pacman-dev mailing list