Help with Slow Performance

[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <OF27497721.42A183B8-ON86257387.00542241-86257387.0057142B@rrd.com>
I'm having a problem with table of data that is causing me no end of grief.
It is happening with APSW and PYSQLITE under Activestate Python 2.4.3.12

I load a table of 130,000 records and after loading several other data
tables.
My load and record times look like this:
Loading MDF...
       4 hdr Records, 0.5017 seconds
       9 seg Records, 0.3253 seconds
       9 mpu Records, 0.3611 seconds
       9 mcr Records, 0.3329 seconds
       9 mpa Records, 0.3302 seconds
       9 cpt Records, 0.2894 seconds
    1872 csm Records, 3.9626 seconds
   20609 cqt Records, 15.6092 seconds
  133001 pqt Records, 81.2074 seconds
Load Complete


When the number of records are > 500, I group them together into one
transaction.

Once loaded I create some views to isolate a subset of the data.

I then do a SELECT COUNT(*) to get the number of records in my view based
on the PQT table after doing eight other similar queries.

This is where I hit thee wall, that Query never completes.  If I run the
exact same Query from SQLITE3.exe tool  all is well and it takes < two
seconds to complete.

The Table in question as I define it.

CREATE TABLE PQT (
  JOBID            char(8),
  CQTDBID          char(8),
  PKGID            char(6),
  PKGZIPCODE       char(6),
  PKGCR            char(4),
  PKGLEVEL         char(1),
  PKGBARCODE       char(20),
  COPIES           char(4),
  PIECES           char(4),
  PKGSTATUS        char(1),
  PQTRECORDSTATUS  char(1),
  BUNDLECHARGE     char(5),
  RESERVE          char(13),
  CC               text
);

CREATE INDEX IDSPQT
  ON PQT
  (JOBID, CQTDBID, PKGID);

Any thoughs I what I'm missing and should be looking for?

Thanks in advance.
Bruce Bromberek

_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.