mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-12 15:33:44 +00:00
ad79ef48a2
* add tests * add bench
42 lines
936 B
Plaintext
42 lines
936 B
Plaintext
|
|
CREATE TABLE t1(a,b,c);
|
|
WITH RECURSIVE c(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM c WHERE x<99)
|
|
INSERT INTO t1(a,b,c) SELECT x, x/10, x%10 FROM c;
|
|
CREATE INDEX t1bc ON t1(b,c);
|
|
SELECT a FROM t1 WHERE b>9 OR b=9 ORDER BY +a;
|
|
|
|
|
|
EXPLAIN QUERY PLAN
|
|
SELECT a FROM t1 WHERE b>9 OR b=9 ORDER BY +a;
|
|
|
|
|
|
SELECT a FROM t1 WHERE b>8 OR (b=8 AND c>7) ORDER BY +a;
|
|
|
|
|
|
EXPLAIN QUERY PLAN
|
|
SELECT a FROM t1 WHERE b>8 OR (b=8 AND c>7) ORDER BY +a;
|
|
|
|
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR b>8 ORDER BY +a;
|
|
|
|
|
|
EXPLAIN QUERY PLAN
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR b>8 ORDER BY +a;
|
|
|
|
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR 8<b ORDER BY +a;
|
|
|
|
|
|
EXPLAIN QUERY PLAN
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR 8<b ORDER BY +a;
|
|
|
|
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR (b>8 AND c NOT IN (4,5,6))
|
|
ORDER BY +a;
|
|
|
|
|
|
EXPLAIN QUERY PLAN
|
|
SELECT a FROM t1 WHERE (b=8 AND c>7) OR (b>8 AND c NOT IN (4,5,6))
|
|
ORDER BY +a;
|
|
|