2011/6/3 Stéphane MANKOWSKI <steph...@mankowski.fr>

>
> 4-EXPLAIN QUERY PLAN SELECT total, total+1, total+2 FROM v_c
> returns:
>        SCAN TABLE c (~74 rows)
>        EXECUTE CORRELATED SCALAR SUBQUERY 1
>        SEARCH TABLE a USING INDEX a_r_a_id (r_a_id=?) (~88 rows)
>        EXECUTE CORRELATED SCALAR SUBQUERY 2
>        SEARCH TABLE a USING INDEX a_r_a_id (r_a_id=?) (~88 rows)
>        EXECUTE CORRELATED SCALAR SUBQUERY 3
>        SEARCH TABLE a USING INDEX a_r_a_id (r_a_id=?) (~88 rows)
>
> For me this is not optimized (but I am not a db specialist) because the
> computation of "total" is done 3 times instead of only one.
>


SQLite does not currently implement common subexpression elimination.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to