On 5 March 2016 at 23:52, Paul Sanderson <sandersonforensics at gmail.com>
wrote:

> That doesn't work for me:
>
> I am trying to avoid (select col1, col2, ... colx ) from ...
>
> and want just a row count which is much less resource intensive.
>

Have you measured this? I think you might be surprised as sqlite doesn't
keep track of the number of rows in each table, so even a "SELECT COUNT(*)
FROM ...;" with no WHERE clause must walk the table structure.

It's true that it doesn't have to extract all the column values for each
row in this case, but unless your rows are _huge_ I expect you'd only see a
marginal performance gain since the same amount of I/O is required for
"SELECT COUNT(*)" and "SELECT col1, col2, ... colx".

-Rowan

Reply via email to