Hi,

Disclaimer: I am a PostgreSQL user and consider myself a SQLite newbie.

I have a program that does mostly? SELECT requests, and it is very 
slow. But I then figured out that, if I rebuild my SQLite database 
without PRIMARY KEY/UNIQUE constraints, the program runs much faster 
(no measurement yet, but I?d say at least 10? faster).

As I understand it, SQLite builds implicit indexes for PRIMARY 
KEY/UNIQUE constraints, but I would not expect those indexes to 
significantly decrease the performance of SELECT requests?

For what it?s worth, my program is written in Python 3, and run on an 
up-to-date Debian Wheezy system, with Python 3.2.3-7, dynamically linked 
with libsqlite3 3.7.13-1+deb7u1.

Is there anything well-known that explains this performance difference?


Thanks for your help,

-- 
Nicolas Boullis

Footnote:
? The program first creates and fills 2 temporary tables, with 
  locally-gathered data, and then only performs SELECT queries with both 
  the 2 temporary tables and the permanent tables. Nothing is ever 
  written to the permanent tables, and the temporary tables are created 
  with no contraint.

Reply via email to