Hi all,

In Skrooge (http://skrooge.org), we use extensively views, and views based on 
views. However, it seems that in such a case, the linked views are computed 
several times. To better explain the issue, Stephane, our main developper, 
created a small use case, explaining the issue :

CREATE TABLE t(x);
INSERT INTO t (x) VALUES ('A');
INSERT INTO t (x) VALUES ('B');
INSERT INTO t (x) VALUES ('C');

CREATE VIEW v_t1 AS SELECT x, random() as "Y" from t;
CREATE VIEW v_t2 AS SELECT x, Y as "Y1", (Y+1) as "Y2" from v_t1;
SELECT x, Y2-Y1 from v_t2;

        The result is:
        A|3495515542145967690
        B|-2850173736877580107
        C|5413870427642078391

        instead of
        A|1
        B|1
        C|1

        ==> WRONG RESULT


While the problem illustrated here leads to a wrong result, the real problem 
for us is on the perfo side : underlying views are recomputed several times 
for a top level view. 

Do you think there is room for improvement here ? Does this sound feasible ?

Thanks :)

Guillaume


-- 
Skrooge, a free, Open Source, personal finances software for linux, Mac OS, 
Windows
http://skrooge.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to