Re: [sqlite] count optimisation

2018-03-15 Thread x
;ryansmit...@gmail.com> Sent: Thursday, March 15, 2018 11:25:18 AM To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] count optimisation On 2018/03/15 12:20 PM, x wrote: > select count(*) from TblA cross join TblB > > is over 200 times slower than > > select (select count(*)

Re: [sqlite] count optimisation

2018-03-15 Thread R Smith
On 2018/03/15 12:20 PM, x wrote: select count(*) from TblA cross join TblB is over 200 times slower than select (select count(*) from TblA) * (select count(*) from TblB); This is a human-level optimisation, it's not efficient for the database engine to do the optimisation. By human-level

[sqlite] count optimisation

2018-03-15 Thread x
select count(*) from TblA cross join TblB is over 200 times slower than select (select count(*) from TblA) * (select count(*) from TblB); Not that it matters to me. I came across it by accident and mention it only in case it’s a missed optimisation.