Repository navigation
Expand file tree
/
Copy path05.sql
More file actions
151 lines (149 loc) · 3.44 KB
/
Copy path05.sql
8000
File metadata and controls
151 lines (149 loc) · 3.44 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
-- $ID$
-- TPC-H/TPC-R Local Supplier Volume Query (Q5)
-- Functional Query Definition
-- Approved February 1998
:x
:o
select
n_name,
sum(l_extendedprice * (1 - l_discount)) as revenue
from
customer,
orders,
lineitem,
supplier,
nation,
region
where
c_custkey = o_custkey
and l_orderkey = o_orderkey
and l_suppkey = s_suppkey
and c_nationkey = s_nationkey
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
and r_name = ':1'
and o_orderdate >= date ':2'
and o_orderdate < date ':2' + interval '1' year
group by
n_name
order by
revenue desc;
:n -1
select
n_name,
from
customer,
orders,
lineitem,
supplier,
nation,
region
where
r_name = ':1'
and n_regionkey = r_regionkey
and s_nationkey = n_nationkey
and l_suppkey = s_suppkey
and l_orderkey = o_orderkey
and c_custkey = o_custkey
and o_orderdate >= date ':2'
and o_orderdate < date ':2' + interval '1' year
GetTokensByCompare
DDN = ?
BOP = EQ
Arg32 = ':3'
COP32 = AND
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (r_name = ':1')
TCN = 1 (region.r_name)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
GetColumnRowsByOffset
SCN = 1
TCN = 2 (region.r_regionkey)
RSPwRID = PREV-0
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (n_regionkey = r_regionkey)
TCN = 8 (nation.n_regionkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FiterResultStacksByColumn
RSP1 = PREV-2
RSP2 = PREV-0
GetColumnRowsByOffset
SCN = 1
TCN = 9 (nation.n_nationkey)
RSPwRID = PREV-0
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (s_nationkey = n_nationkey)
TCN = 15 (supplier.s_nationkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByRID
RSP1 = PREV-3
RSP2 = PREV-0
GetColumnRowsByOffset
SCN = 1
TCN = 16 (supplier.s_suppkey)
RSPwRID = PREV-0
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (s_suppkey = l_suppkey)
TCN = 20 (lineitem.l_suppkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByRID
RSP1 = PREV-3
RSP2 = PREV-0
GetColumnRowsByOffset
SCN = 1
TCN = 21 (lineitem.l_orderkey)
RSPwRID = PREV-0
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (l_orderkey = o_orderkey)
TCN = 25 (orders.o_orderkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByRID
RSP1 = PREV-3
RSP2 = PREV-0
GetColumnRowsByOffset
SCN = 1
TCN = 26 (orders.o_custkey)
RSPwRID = PREV-0
SendStackToArg32
RSP = PREV-0
GetColumnRowsByIndexCompare (c_custkey = o_custkey)
TCN = 30 (customer.c_custkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByRID
RSP1 = PREV-3
RSP2 = PREV-0
??? filter o_orderdate < '1995-01-01' from previous stack
??? filter l_shipdate > '1995-01-01' from previous stack
GetColumnRowsByOffset
TCN = 10 (nation.n_name)
SCN = 1
RSPwRID = PREV-0