Re: [sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Alexey Pechnikov
Hello! On Thursday 01 April 2010 18:04:10 Adam DeVita wrote: > How does > $ time sqlite3 test32k.db "select count(1) from role_exist" > perform? Equal to count(*). Best regards, Alexey Pechnikov. http://pechnikov.tel/ ___ sqlite-users mailing list

Re: [sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Jay A. Kreibich
On Thu, Apr 01, 2010 at 10:44:51AM -0400, Pavel Ivanov scratched on the wall: > > So 58s for count of all records! The count(*) for all records may use > > the counter from primary key b-tree, is't it? > > What does this mean? I believe there's no any kind of counters in > b-tree. If you meant

Re: [sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Pavel Ivanov
> So 58s for count of all records! The count(*) for all records may use > the counter from primary key b-tree, is't it? What does this mean? I believe there's no any kind of counters in b-tree. If you meant counter from auto-increment key then how about gaps in the middle? Pavel On Thu, Apr 1,

Re: [sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Adam DeVita
How does $ time sqlite3 test32k.db "select count(1) from role_exist" perform? On Thu, Apr 1, 2010 at 5:52 AM, Alexey Pechnikov wrote: > Hello! > > $ time sqlite3 test32k.db "select count(*) from role_exist" > 1250 > > real0m58.908s > user0m0.056s > sys

[sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Alexey Pechnikov
Hello! $ time sqlite3 test32k.db "select count(*) from role_exist" 1250 real0m58.908s user0m0.056s sys 0m0.864s $ sqlite3 test32k.db SQLite version 3.6.23 sqlite> .schema role_exist CREATE TABLE role_exist ( id INTEGER PRIMARY KEY, uid BLOB NOT NULL DEFAULT (randomblob(16))