mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-12 15:33:44 +00:00
ad79ef48a2
* add tests * add bench
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
|
|
CREATE VIEW v2 AS SELECT * FROM t1 INDEXED BY i1 WHERE a > 5;
|
|
EXPLAIN QUERY PLAN SELECT * FROM v2
|
|
|
|
|
|
EXPLAIN QUERY PLAN SELECT * FROM v2 WHERE b = 10
|
|
|
|
|
|
CREATE TABLE x1(a, b TEXT);
|
|
CREATE INDEX x1i ON x1(a, b);
|
|
INSERT INTO x1 VALUES(1, 1);
|
|
INSERT INTO x1 VALUES(1, 1);
|
|
INSERT INTO x1 VALUES(1, 1);
|
|
INSERT INTO x1 VALUES(1, 1);
|
|
|
|
|
|
SELECT a,b,rowid FROM x1 INDEXED BY x1i WHERE a=1 AND b=1 AND rowid=3;
|
|
|
|
|
|
SELECT a,b,rowid FROM x1 INDEXED BY x1i WHERE a=1 AND b=1 AND rowid='3';
|
|
|
|
|
|
SELECT a,b,rowid FROM x1 INDEXED BY x1i WHERE a=1 AND b=1 AND rowid='3.0';
|
|
|
|
|
|
CREATE TABLE x2(c INTEGER PRIMARY KEY, a, b TEXT);
|
|
CREATE INDEX x2i ON x2(a, b);
|
|
INSERT INTO x2 VALUES(1, 1, 1);
|
|
INSERT INTO x2 VALUES(2, 1, 1);
|
|
INSERT INTO x2 VALUES(3, 1, 1);
|
|
INSERT INTO x2 VALUES(4, 1, 1);
|
|
|
|
|
|
SELECT a,b,c FROM x2 INDEXED BY x2i WHERE a=1 AND b=1 AND c=3;
|
|
|
|
|
|
SELECT a,b,c FROM x2 INDEXED BY x2i WHERE a=1 AND b=1 AND c='3';
|
|
|
|
|
|
SELECT a,b,c FROM x2 INDEXED BY x2i WHERE a=1 AND b=1 AND c='3.0';
|
|
|
|
|
|
CREATE TABLE o1(x INTEGER PRIMARY KEY, y, z);
|
|
CREATE INDEX p1 ON o1(z);
|
|
CREATE INDEX p2 ON o1(y) WHERE z=1;
|
|
|
|
|
|
DROP INDEX p1;
|
|
DROP INDEX p2;
|
|
CREATE INDEX p2 ON o1(y) WHERE z=1;
|
|
CREATE INDEX p1 ON o1(z);
|
|
|