[Yum-devel] sqlite table creation question

seth vidal skvidal at phy.duke.edu
Fri Mar 4 10:16:34 UTC 2005


On Fri, 2005-03-04 at 04:37 -0500, seth vidal wrote:
> in sqlitecache.py it does:
>     def createTablesFilelists(self,db):
>         """Create the required tables for filelists metadata in the sqlite 
>            database"""
>         cur = db.cursor()
>         self.createDbInfo(cur)
>         # This table is needed to match pkgKeys to pkgIds
>         cur.execute("""CREATE TABLE packages(
>             pkgKey INTEGER PRIMARY KEY,
>             pkgId TEXT)
>         """)
>         cur.execute("""CREATE TABLE filelist(
>             pkgKey INTEGER,
>             dirname TEXT,
>             filenames TEXT,
>             filetypes TEXT)
>         """)
>         cur.execute("CREATE INDEX keyfile ON filelist (pkgKey)")
>         cur.execute("CREATE INDEX pkgId ON packages (pkgId)")
> 
> 
> two questions:
>  1. why do we make the packages table? If that table doesn't exist
> shouldn't we just raise and return b/c the sacks are being inserted out
> of order?
> 
>  2. how much benefit are the indexes? How much does it help on insert if
> we don't make them?

Okay, since we're dealing with data we don't have to worry with being
destroyed or lost in a power-outage/disk-fail situation - have we done
any testing with the inserts with:
PRAGMA synchronous = OFF;

?

I'm going to play and see if it has any good behavior or if we end up
with a giant flush at db.commit()

-sv






More information about the Yum-devel mailing list