Hi, I have a table with 500,000 records. The following is the schema of that table:
CREATE TABLE ES_SRC_MEDIA_INFO (GID INTEGER PRIMARY KEY AUTOINCREMENT, MEDIAPATH VARCHAR(256) NOT NULL UNIQUE, BYTES_USED LONG, BYTES_ON_DISK LONG, MTIME LONG, CTIME LONG, TYPE VARCHAR(20), CATEGORY VARCHAR(20), TIMESTAMP LONG, JOBID VARCHAR(30) Main question: Using DBD-SQLite, select count(gid) from es_src_media_info takes 130 secs. What gives? I added an unique index on GID and tried it select count(gid) from es_src_media_info where gid >= 1. It took around 90 seconds this time. Is there any way to speed this up other than adding a trigger? Small question: Does sqlite take the column types and length into consideration while creating the table? Thanks, Raj