[Yum-devel] sqlite table creation question

seth vidal skvidal at phy.duke.edu
Fri Mar 4 09:37:03 UTC 2005


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?

-sv





More information about the Yum-devel mailing list