-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
presentation
72 lines (66 loc) · 1.76 KB
/
presentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
exec-ddl
CREATE TABLE a (x INT PRIMARY KEY, y INT)
----
TABLE a
├── x int not null
├── y int
└── INDEX primary
└── x int not null
exec-ddl
CREATE TABLE t.b (x INT, y FLOAT)
----
TABLE b
├── x int
├── y float
├── rowid int not null (hidden)
└── INDEX primary
└── rowid int not null (hidden)
# Scan operator.
opt
SELECT a.y, a.x, a.y y2 FROM a
----
scan a
└── columns: y:2(int) x:1(int!null) y2:2(int)
# Select operator.
opt
SELECT a.y, a.x, a.y y2 FROM a WHERE x=1
----
scan a,constrained
├── columns: y:2(int) x:1(int!null) y2:2(int)
└── constraint: /1: [/1 - /1]
# Project operator.
opt
SELECT 1+a.y AS plus, a.x FROM a
----
project
├── columns: plus:3(int) x:1(int!null)
├── scan a
│ └── columns: a.x:1(int!null) a.y:2(int)
└── projections
├── plus [type=int]
│ ├── variable: a.y [type=int]
│ └── const: 1 [type=int]
└── variable: a.x [type=int]
# Join operator.
opt
SELECT b.x, rowid, a.y, a.x, a.y y2, b.y FROM a, b
----
inner-join
├── columns: x:3(int) rowid:5(int!null) y:2(int) x:1(int!null) y2:2(int) y:4(float)
├── scan a
│ └── columns: a.x:1(int!null) a.y:2(int)
├── scan b
│ └── columns: b.x:3(int) b.y:4(float) b.rowid:5(int!null)
└── true [type=bool]
# Groupby operator.
opt
SELECT MAX(y), y, y, x FROM a GROUP BY a.x, a.y
----
group-by
├── columns: column3:3(int) y:2(int) y:2(int) x:1(int!null)
├── grouping columns: a.x:1(int!null) a.y:2(int)
├── scan a
│ └── columns: a.x:1(int!null) a.y:2(int)
└── aggregations
└── function: max [type=int]
└── variable: a.y [type=int]