On Wed, Oct 16, 2013 at 10:29 AM, Daniel Polski <dan...@agelektronik.se>wrote:

> Hello,
> Does the ANALYZE command gather statistics and optimize for views I've
> created or only "real tables"?
>

Only real tables.

Views are just macros that are applied to queries when the queries are run.
If you have:

     CREATE TABLE t1(a,b,c);
     CREATE VIEW v1 AS SELECT a+b, c+a FROM t1;

Then you do:

     SELECT * FROM v1;

That's exactly the same as doing:

     SELECT * FROM (SELECT a+b, c+a FROM t1);



-- 
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