Repository navigation
Expand file tree
/
Copy path11.sql
More file actions
115 lines (113 loc) · 2.1 KB
/
Copy path11.sql
File metadata and controls
115 lines (113 loc) · 2.1 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
-- $ID$
-- TPC-H/TPC-R Important Stock Identification Query (Q11)
-- Functional Query Definition
-- Approved February 1998
:x
:o
select
ps_partkey,
sum(ps_supplycost * ps_availqty) as value
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = ':1'
group by
ps_partkey having
sum(ps_supplycost * ps_availqty) > (
select
sum(ps_supplycost * ps_availqty) * :2
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = ':1'
)
order by
value desc;
:n -1
select
sum(ps_supplycost * ps_availqty) * :2
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = ':1'
GetColumnRowsByFTSCompare
TCN = 1 (partsupp.ps_suppkey)
SCN = 1
BOP = nil
Arg32 = nil
COP32 = nil
RRI = 1
SendStackToArg32
SCN = 1
RSPwRID = PREV-0
GetColumnRowsByIndexCompare
TCN = 2 (supplier.s_suppkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByColumn (ps_suppkey = s_suppkey)
RSP1 = PREV-2
RSP2 = PREV-0
GetColumnRowsByFTSCompare
TCN = 3 (supplier.s_nationkey)
SCN = 1
BOP = nil
Arg32 = nil
COP32 = nil
RRI = 1
SendStackToArg32
SCN = 1
RSPwRID = PREV-0
GetColumnRowsByIndexCompare
TCN = 4 (nation.n_nationkey)
SCN = 1
BOP = OR
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByColumn (s_nationkey = n_nationkey)
RSP1 = PREV-2
RSP2 = PREV-0
FilterResultStacksByRID (ps_suppkey = s_suppkey and s_nationkey = n_nationkey)
RSP1 = PREV-4
RSP2 = PREV-0
GetTokensByCompare (dtok(':1'))
TCN = 5 (nation.n_name)
BOP = nil
Arg32 = ':1'
COP32 = EQ
SendStackToArg32
SCN = 1
RSPwRID = PREV-0
GetColumnRowsByIndexCompare (n_name = dtok(':1'))
TCN = 5 (nation.n_name)
SCN = 1
BOP = nil
Arg32 = PREV-0
COP32 = EQ
RRI = 1
FilterResultStacksByRID ((ps_suppkey = s_suppkey and s_nationkey = n_nationkey) and n_name = dtok(':1'))
RSP1 = PREV-3
RSP2 = PREV-0
GetColumnRowsByOffset
TCN = 6 (supplier.ps_supplycost)
SCN = 1
RSPwRID = PREV-0
GetColumnRowsByOffset
TCN = 7 (supplier.ps_availqty)
SCN = 1
RSPwRID = PREV-0