Re: [sqlite] count registers in a table

2016-12-26 Thread Simon Slavin
On 26 Dec 2016, at 3:14pm, MONSTRUO Hugo González wrote: > I have a table with 726.000 registers. > > SELECT COUNT(*) FROM MyTable << is very slowly > > SELECT COUNT (RowId) FROM MyTable ORDER BY PrimaryIndex << is very FAST While this is not a bug in SQLite, since it reaches the right answe

Re: [sqlite] count registers in a table

2016-12-26 Thread Donald Griggs
Hello, Hugo, Regarding: "I have a table with 726.000 registers." 1) I assume that you mean what others call "rows" correct? (and not columns, I hope) 2) Regarding: "SELECT COUNT(*) FROM MyTable << is very slowly" As I understand it, that should be as fast as SELECT COUNT (RowId) as of late

Re: [sqlite] count registers in a table

2016-12-26 Thread MONSTRUO Hugo González
> Which is the fastest way to count the records of a table. ? And records > that meet a condition? I have a table with 726.000 registers. SELECT COUNT(*) FROM MyTable << is very slowly SELECT COUNT (RowId) FROM MyTable ORDER BY PrimaryIndex << is very FAST SELECT COUNT(RowId) FROM MyTable WHERE

Re: [sqlite] count registers in a table

2016-12-25 Thread Simon Slavin
On 24 Dec 2016, at 10:52am, MONSTRUO Hugo González wrote: > Which is the fastest way to count the records of a table. ? And records > that meet a condition? SELECT COUNT(*) FROM MyTable SELECT COUNT(*) FROM MyTable WHERE a = b There is special optimization for COUNT with a * which can some

[sqlite] count registers in a table

2016-12-25 Thread MONSTRUO Hugo González
Hi, Which is the fastest way to count the records of a table. ? And records that meet a condition? regards ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users