On 6 Jul 2017, at 9:52am, Dominique Devienne <ddevie...@gmail.com> wrote:

> With all 4 counts, the views takes ~ 6.5s to compute its 1 row

Just checking ….

Do you have an index on keys(code_type) ?

Would it not be possible to express this VIEW without the "WITH" construction ? 
 For instance if there is a "SETS" row for every row you want in the VIEW, you 
could just use

SELECT … FROM keys AS kSet
        JOIN keys AS Cst WHERE Cst.code_type = kSet.code_type
        JOIN …
        JOIN …
        WHERE code_type = "SETS"

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to