Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d07684

Browse files
committed
Changes needed to use core hooks proposed.
1 parent9dcc7b3 commit7d07684

9 files changed

+191
-171
lines changed

‎aqo.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ set_baserel_rows_estimate_hook_typeprev_set_baserel_rows_estimate_hook;
115115
get_parameterized_baserel_size_hook_typeprev_get_parameterized_baserel_size_hook;
116116
set_joinrel_size_estimates_hook_typeprev_set_joinrel_size_estimates_hook;
117117
get_parameterized_joinrel_size_hook_typeprev_get_parameterized_joinrel_size_hook;
118-
ExplainOnePlan_hook_typeprev_ExplainOnePlan_hook;
119-
ExplainOneNode_hook_typeprev_ExplainOneNode_hook;
118+
explain_per_plan_hook_typeprev_explain_per_plan_hook=NULL;
119+
explain_per_node_hook_typeprev_explain_per_node_hook=NULL;
120120
staticshmem_request_hook_typeprev_shmem_request_hook=NULL;
121121
staticobject_access_hook_typeprev_object_access_hook;
122122

@@ -480,10 +480,10 @@ _PG_init(void)
480480
create_plan_hook=aqo_create_plan_hook;
481481

482482
/* Service hooks. */
483-
prev_ExplainOnePlan_hook=ExplainOnePlan_hook;
484-
ExplainOnePlan_hook=print_into_explain;
485-
prev_ExplainOneNode_hook=ExplainOneNode_hook;
486-
ExplainOneNode_hook=print_node_explain;
483+
prev_explain_per_plan_hook=explain_per_plan_hook;
484+
explain_per_plan_hook=print_into_explain;
485+
prev_explain_per_node_hook=explain_per_node_hook;
486+
explain_per_node_hook=print_node_explain;
487487

488488
prev_create_upper_paths_hook=create_upper_paths_hook;
489489
create_upper_paths_hook=aqo_store_upper_signature_hook;

‎aqo.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ extern set_joinrel_size_estimates_hook_type
252252
prev_set_joinrel_size_estimates_hook;
253253
externget_parameterized_joinrel_size_hook_type
254254
prev_get_parameterized_joinrel_size_hook;
255-
externExplainOnePlan_hook_typeprev_ExplainOnePlan_hook;
256-
externExplainOneNode_hook_typeprev_ExplainOneNode_hook;
255+
externexplain_per_plan_hook_typeprev_explain_per_plan_hook;
256+
externexplain_per_node_hook_typeprev_explain_per_node_hook;
257257

258258
externvoidppi_hook(ParamPathInfo*ppi);
259259
externintaqo_statement_timeout;
@@ -269,12 +269,15 @@ extern bool load_fss_ext(uint64 fs, int fss, OkNNrdata *data, List **reloids);
269269
externboolupdate_fss_ext(uint64fs,intfss,OkNNrdata*data,List*reloids);
270270

271271
/* Query preprocessing hooks */
272-
externvoidprint_into_explain(PlannedStmt*plannedstmt,IntoClause*into,
273-
structExplainState*es,constchar*queryString,
272+
externvoidprint_into_explain(PlannedStmt*ps,
273+
IntoClause*into,
274+
structExplainState*es,
275+
constchar*queryString,
274276
ParamListInfoparams,
275-
constinstr_time*planduration,
276277
QueryEnvironment*queryEnv);
277-
externvoidprint_node_explain(structExplainState*es,PlanState*ps,Plan*plan);
278+
externvoidprint_node_explain(PlanState*ps,List*ancestors,
279+
constchar*relationship,constchar*plan_name,
280+
structExplainState*es);
278281

279282
/* Cardinality estimation */
280283
externdoublepredict_for_relation(List*restrict_clauses,List*selectivities,

‎expected/aqo_fdw.out

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ SELECT str FROM expln('
6666
str
6767
-----------------------------------------------------------
6868
Foreign Scan on public.frgn (actual rows=1.00 loops=1)
69-
AQO not used
7069
Output: x
7170
Remote SQL: SELECT x FROM public.local WHERE ((x < 10))
71+
AQO not used
7272
Using aqo: true
7373
AQO mode: LEARN
7474
JOINS: 0
@@ -81,9 +81,9 @@ SELECT str FROM expln('
8181
str
8282
-----------------------------------------------------------
8383
Foreign Scan on public.frgn (actual rows=1.00 loops=1)
84-
AQO: rows=1, error=0%
8584
Output: x
8685
Remote SQL: SELECT x FROM public.local WHERE ((x < 10))
86+
AQO: rows=1, error=0%
8787
Using aqo: true
8888
AQO mode: LEARN
8989
JOINS: 0
@@ -108,8 +108,8 @@ SELECT str FROM expln('
108108
str
109109
---------------------------------------------------------------
110110
Merge Join (actual rows=1.00 loops=1)
111-
AQO not used
112111
Merge Cond: (a.x = b.x)
112+
AQO not used
113113
-> Sort (actual rows=1.00 loops=1)
114114
Sort Key: a.x
115115
-> Foreign Scan on frgn a (actual rows=1.00 loops=1)
@@ -131,10 +131,10 @@ SELECT str FROM expln('
131131
str
132132
--------------------------------------------------------------------------------------------------------
133133
Foreign Scan (actual rows=1.00 loops=1)
134-
AQO: rows=1, error=0%
135134
Output: a.x, b.x
136135
Relations: (public.frgn a) INNER JOIN (public.frgn b)
137136
Remote SQL: SELECT r1.x, r2.x FROM (public.local r1 INNER JOIN public.local r2 ON (((r1.x = r2.x))))
137+
AQO: rows=1, error=0%
138138
Using aqo: true
139139
AQO mode: LEARN
140140
JOINS: 0
@@ -153,8 +153,8 @@ WHERE a.aid = b.aid AND b.bval like 'val%';
153153
QUERY PLAN
154154
-----------------------------------------------
155155
Foreign Scan (actual rows=1000.00 loops=1)
156-
AQO not used
157156
Relations: (frgn_a a) INNER JOIN (frgn_b b)
157+
AQO not used
158158
Using aqo: true
159159
AQO mode: LEARN
160160
JOINS: 0
@@ -166,8 +166,8 @@ WHERE a.aid = b.aid AND b.bval like 'val%';
166166
QUERY PLAN
167167
-----------------------------------------------
168168
Foreign Scan (actual rows=1000.00 loops=1)
169-
AQO: rows=1000, error=0%
170169
Relations: (frgn_a a) INNER JOIN (frgn_b b)
170+
AQO: rows=1000, error=0%
171171
Using aqo: true
172172
AQO mode: LEARN
173173
JOINS: 0
@@ -207,17 +207,17 @@ WHERE str NOT LIKE '%Memory%';
207207
Append (actual rows=1000.00 loops=1)
208208
AQO not used
209209
-> Foreign Scan (actual rows=400.00 loops=1)
210-
AQO not used
211210
Relations: (main_p0 a_1) INNER JOIN (ref_p0 b_1)
212-
-> Foreign Scan (actual rows=300.00 loops=1)
213211
AQO not used
212+
-> Foreign Scan (actual rows=300.00 loops=1)
214213
Relations: (main_p1 a_2) INNER JOIN (ref_p1 b_2)
215-
-> Hash Join (actual rows=300.00 loops=1)
216214
AQO not used
215+
-> Hash Join (actual rows=300.00 loops=1)
217216
Hash Cond: (b_3.aid = a_3.aid)
217+
AQO not used
218218
-> Seq Scan on ref_p2 b_3 (actual rows=300.00 loops=1)
219-
AQO not used
220219
Filter: (bval ~~ 'val%'::text)
220+
AQO not used
221221
-> Hash (actual rows=38.00 loops=1)
222222
-> Seq Scan on main_p2 a_3 (actual rows=38.00 loops=1)
223223
AQO not used
@@ -237,17 +237,17 @@ WHERE str NOT LIKE '%Memory%';
237237
Append (actual rows=1000.00 loops=1)
238238
AQO not used
239239
-> Foreign Scan (actual rows=400.00 loops=1)
240-
AQO: rows=400, error=0%
241240
Relations: (main_p0 a_1) INNER JOIN (ref_p0 b_1)
241+
AQO: rows=400, error=0%
242242
-> Foreign Scan (actual rows=300.00 loops=1)
243-
AQO: rows=300, error=0%
244243
Relations: (main_p1 a_2) INNER JOIN (ref_p1 b_2)
245-
-> Hash Join (actual rows=300.00 loops=1)
246244
AQO: rows=300, error=0%
245+
-> Hash Join (actual rows=300.00 loops=1)
247246
Hash Cond: (b_3.aid = a_3.aid)
247+
AQO: rows=300, error=0%
248248
-> Seq Scan on ref_p2 b_3 (actual rows=300.00 loops=1)
249-
AQO: rows=300, error=0%
250249
Filter: (bval ~~ 'val%'::text)
250+
AQO: rows=300, error=0%
251251
-> Hash (actual rows=38.00 loops=1)
252252
-> Seq Scan on main_p2 a_3 (actual rows=38.00 loops=1)
253253
AQO: rows=38, error=0%
@@ -266,14 +266,14 @@ SELECT * FROM frgn AS a, frgn AS b WHERE a.x<b.x;
266266
QUERY PLAN
267267
---------------------------------------------------------------
268268
Nested Loop (actual rows=0.00 loops=1)
269-
AQO not used
270269
Join Filter: (a.x < b.x)
271270
Rows Removed by Join Filter: 1
271+
AQO not used
272272
-> Foreign Scan on frgn a (actual rows=1.00 loops=1)
273273
AQO not used
274274
-> Materialize (actual rows=1.00 loops=1)
275-
AQO not used
276275
Storage: Memory Maximum Storage: 17kB
276+
AQO not used
277277
-> Foreign Scan on frgn b (actual rows=1.00 loops=1)
278278
AQO not used
279279
Using aqo: true
@@ -288,10 +288,10 @@ SELECT str FROM expln('
288288
str
289289
--------------------------------------------------------------------------------------------------------
290290
Foreign Scan (actual rows=0.00 loops=1)
291-
AQO: rows=1, error=100%
292291
Output: a.x, b.x
293292
Relations: (public.frgn a) INNER JOIN (public.frgn b)
294293
Remote SQL: SELECT r1.x, r2.x FROM (public.local r1 INNER JOIN public.local r2 ON (((r1.x < r2.x))))
294+
AQO: rows=1, error=100%
295295
Using aqo: true
296296
AQO mode: LEARN
297297
JOINS: 0

‎expected/feature_subspace.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ WHERE str NOT LIKE '%Memory%';
3131
result
3232
--------------------------------------------------------
3333
Merge Left Join (actual rows=10.00 loops=1)
34-
AQO not used
3534
Merge Cond: (a.x = b.x)
35+
AQO not used
3636
-> Sort (actual rows=10.00 loops=1)
3737
Sort Key: a.x
3838
-> Seq Scan on a (actual rows=10.00 loops=1)
@@ -54,8 +54,8 @@ WHERE str NOT LIKE '%Memory%';
5454
result
5555
--------------------------------------------------------
5656
Merge Left Join (actual rows=100.00 loops=1)
57-
AQO not used
5857
Merge Cond: (b.x = a.x)
58+
AQO not used
5959
-> Sort (actual rows=100.00 loops=1)
6060
Sort Key: b.x
6161
-> Seq Scan on b (actual rows=100.00 loops=1)

‎expected/gucs.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ SELECT regexp_replace(
3535
str
3636
---------------------------------------------------
3737
Seq Scan on public.t (actual rows=100.00 loops=1)
38-
AQO not used
3938
Output: x
39+
AQO not used
4040
Query Identifier: N
4141
Using aqo: true
4242
AQO mode: LEARN
@@ -51,8 +51,8 @@ SELECT regexp_replace(
5151
str
5252
---------------------------------------------------
5353
Seq Scan on public.t (actual rows=100.00 loops=1)
54-
AQO: rows=100, error=0%
5554
Output: x
55+
AQO: rows=100, error=0%
5656
Query Identifier: N
5757
Using aqo: true
5858
AQO mode: LEARN

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp