@@ -7,15 +7,20 @@ sqlrs is an in-process sql query engine that designed for OLAP
77- It achieved columnar-vectorized execution engine.
88- It will support pipeline parallelism execution in the future.
99
10+ 🚧 The project is actively developing a new planner V2 that inspired by DuckDB, and will replace the planner v1 in the future.🚧
11+
1012# SQL demo
1113
12- currently, the following SQL statements are supported, execute ` make run ` into interactive mode to test them:
14+ currently, the following SQL statements are supported, execute the commands into interactive mode to test them:
15+
16+ - ` make run ` : run sqlrs in planner_v1
17+ - ` make run_v2 ` : run sqlrs in planner_v2
1318
1419``` sql
15- -- supported in Roadmap 0.1
20+ -- supported in Roadmap 0.1 (planner_v1)
1621select first_name from employee where last_name = ' Hopkins' ;
1722
18- -- supported in Roadmap 0.2
23+ -- supported in Roadmap 0.2 (planner_v1)
1924select sum (salary+ 1 ), count (salary), max (salary) from employee where id > 1 ;
2025select state, count (state), sum (salary) from employee group by state;
2126-- load csv table
@@ -24,16 +29,16 @@ select state, count(state), sum(salary) from employee group by state;
2429-- show tables
2530\dt
2631
27- -- supported in Roadmap 0.3
32+ -- supported in Roadmap 0.3 (planner_v1)
2833select id from employee order by id desc offset 2 limit 1 ;
2934select * from employee left join state on employee .state = state .state_code and state .state_name != ' California State' ;
3035
31- -- supported in Roadmap 0.4
36+ -- supported in Roadmap 0.4 (planner_v1)
3237-- explain plan tree
3338\explain select a from t1;
3439-- Heuristic Optimizer that includes rules such as: Column pruning, Predicates pushdown, Limit pushdown etc.
3540
36- -- supported in Roadmap 0.5
41+ -- supported in Roadmap 0.5 (planner_v1)
3742-- distinct
3843select distinct state from employee;
3944select count (distinct(b)) from t2;
@@ -43,6 +48,21 @@ select t.a from t1 t where t.b > 1 order by t.a desc limit 1;
4348-- uncorrelated scalar subquery
4449select t.* from (select * from t1 where a > 1 ) t where t .b > 7 ;
4550select a, (select max (b) from t1) max_b from t1;
51+
52+
53+ -- supported in Roadmap 0.6 (planner_v2)
54+ -- create and insert table in memory
55+ create table t1 (v1 int , v2 int , v3 int );
56+ insert into t1 values (0 , 4 , 1 ), (1 , 5 , 2 );
57+ select * from t1;
58+ -- select only expressions
59+ select 1 , 2 .3 , ' 😇' , true, null ;
60+ -- pragma commands
61+ show tables;
62+ describe t1;
63+ -- previous SQL statements
64+ select v1+ 1 as a from t1 where a >= 2 ;
65+ select v1 from t1 limit 2 offset 1 ;
4666```
4767
4868
@@ -54,6 +74,8 @@ High level description:
5474- Roadmap 0.2: Support aggregation operators, e2e testing framework and interactive mode
5575- Roadmap 0.3: Support limit, order, and join operators
5676- Roadmap 0.4: Introduce a Heuristic Optimizer and common optimization rules
77+ - Roadmap 0.5: Support distinct, alias, and uncorrelated scalar subquery
78+ - Roadmap 0.6: New planner_v2 highly inspired by DuckDB
5779
5880Please see [ Roadmap] ( https://github.com/Fedomn/sqlrs/issues?q=roadmap ) for more information of implementation steps
5981
0 commit comments