The statement "select count() from <table>" is optimized to retrieve the count without visiting each row. This is well documented behaviour.
-----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:[email protected]] Im Auftrag von x Gesendet: Donnerstag, 15. März 2018 11:20 An: [email protected] Betreff: [EXTERNAL] [sqlite] count optimisation 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. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

