On 7/18/06, Sripathi Raj <[EMAIL PROTECTED]> wrote:
Hi Jay,

 I have a database whose size is around 250 MB. I have a table which has
around 140,000 records. Doing a count(*) on that takes me 473 seconds. I
believe it's not supposed to take that much time.

SQLite does not keep count of rows in a table. So when you execute
SELECT COUNT(*) FROM table;
what SQLite does is step through table row by row and count them.
Only way to get the total number of rows in a table faster is to keep
track of it yourself. This can easily be done using insert/delete
triggers that will increment/decrement row count in a separate table.
Complete examples of such code were posted to list before. Look for it
in archives.

--
Nemanja Corlija <[EMAIL PROTECTED]>

Reply via email to