You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compile time doubles with every EXISTS in a query #3133
alasql('CREATE TABLE t (a INT); INSERT INTO t VALUES (1)');alasql('CREATE TABLE w (b INT); INSERT INTO w VALUES (1)');for(constnof[10,12,14,16]){constsql='SELECT a FROM t WHERE '+Array(n).fill('EXISTS (SELECT 1 FROM w)').join(' AND ');conststart=Date.now();alasql(sql);console.log(n,Date.now()-start,'ms');}
It prints about 25, 50, 220 and 800 ms. Every EXISTS doubles the time, as a SELECT is compiled 2^n times for n EXISTS (4,096 times for 12).
The time should grow linearly, with one compile per SELECT.
Activity