@@ -24,23 +24,25 @@ ANALYZE local;
24
24
-- Trivial foreign scan.s
25
25
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
26
26
SELECT x FROM frgn;
27
- QUERY PLAN
28
- -------------------------------------------------------------
29
- Foreign Scan on frgn (actual rows=1 loops=1) (AQO not used)
27
+ QUERY PLAN
28
+ ----------------------------------------------
29
+ Foreign Scan on frgn (actual rows=1 loops=1)
30
+ AQO not used
30
31
Using aqo: true
31
32
AQO mode: LEARN
32
33
JOINS: 0
33
- (4 rows)
34
+ (5 rows)
34
35
35
36
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
36
37
SELECT x FROM frgn;
37
- QUERY PLAN
38
- -----------------------------------------------------------------------------
39
- Foreign Scan on frgn (actual rows=1 loops=1) (AQO: cardinality=1, error=0%)
38
+ QUERY PLAN
39
+ ----------------------------------------------
40
+ Foreign Scan on frgn (actual rows=1 loops=1)
41
+ AQO: rows=1, error=0%
40
42
Using aqo: true
41
43
AQO mode: LEARN
42
44
JOINS: 0
43
- (4 rows)
45
+ (5 rows)
44
46
45
47
-- Push down base filters. Use verbose mode to see filters.
46
48
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, VERBOSE))
@@ -50,83 +52,93 @@ LINE 1: ...LAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, VERBOSE))
50
52
^
51
53
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, VERBOSE)
52
54
SELECT x FROM frgn WHERE x < 10;
53
- QUERY PLAN
54
- --------------------------------------------------------------------
55
- Foreign Scan on public.frgn (actual rows=1 loops=1) (AQO not used)
55
+ QUERY PLAN
56
+ -----------------------------------------------------------
57
+ Foreign Scan on public.frgn (actual rows=1 loops=1)
58
+ AQO not used
56
59
Output: x
57
60
Remote SQL: SELECT x FROM public.local WHERE ((x < 10))
58
61
Using aqo: true
59
62
AQO mode: LEARN
60
63
JOINS: 0
61
- (6 rows)
64
+ (7 rows)
62
65
63
66
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
64
67
SELECT x FROM frgn WHERE x < -10; -- AQO ignores constants
65
- QUERY PLAN
66
- -------------------------------------------------------------------------------
67
- Foreign Scan on frgn (actual rows=0 loops=1) (AQO: cardinality=1, error=100%)
68
+ QUERY PLAN
69
+ ----------------------------------------------
70
+ Foreign Scan on frgn (actual rows=0 loops=1)
71
+ AQO: rows=1, error=100%
68
72
Using aqo: true
69
73
AQO mode: LEARN
70
74
JOINS: 0
71
- (4 rows)
75
+ (5 rows)
72
76
73
77
-- Trivial JOIN push-down.
74
78
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
75
79
SELECT * FROM frgn AS a, frgn AS b WHERE a.x=b.x;
76
- QUERY PLAN
77
- ---------------------------------------------------------------------------
78
- Merge Join (actual rows=1 loops=1) (AQO not used)
80
+ QUERY PLAN
81
+ ------------------------------------------------------------
82
+ Merge Join (actual rows=1 loops=1)
83
+ AQO not used
79
84
Merge Cond: (a.x = b.x)
80
- -> Sort (actual rows=1 loops=1) (AQO not used)
85
+ -> Sort (actual rows=1 loops=1)
86
+ AQO not used
81
87
Sort Key: a.x
82
88
Sort Method: quicksort Memory: 25kB
83
- -> Foreign Scan on frgn a (actual rows=1 loops=1) (AQO not used)
84
- -> Sort (actual rows=1 loops=1) (AQO not used)
89
+ -> Foreign Scan on frgn a (actual rows=1 loops=1)
90
+ AQO not used
91
+ -> Sort (actual rows=1 loops=1)
92
+ AQO not used
85
93
Sort Key: b.x
86
94
Sort Method: quicksort Memory: 25kB
87
- -> Foreign Scan on frgn b (actual rows=1 loops=1) (AQO not used)
95
+ -> Foreign Scan on frgn b (actual rows=1 loops=1)
96
+ AQO not used
88
97
Using aqo: true
89
98
AQO mode: LEARN
90
99
JOINS: 0
91
- (13 rows)
100
+ (18 rows)
92
101
93
102
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, VERBOSE)
94
103
SELECT * FROM frgn AS a, frgn AS b WHERE a.x=b.x;
95
104
QUERY PLAN
96
105
--------------------------------------------------------------------------------------------------------
97
- Foreign Scan (actual rows=1 loops=1) (AQO: cardinality=1, error=0%)
106
+ Foreign Scan (actual rows=1 loops=1)
107
+ AQO: rows=1, error=0%
98
108
Output: a.x, b.x
99
109
Relations: (public.frgn a) INNER JOIN (public.frgn b)
100
110
Remote SQL: SELECT r1.x, r2.x FROM (public.local r1 INNER JOIN public.local r2 ON (((r1.x = r2.x))))
101
111
Using aqo: true
102
112
AQO mode: LEARN
103
113
JOINS: 0
104
- (7 rows)
114
+ (8 rows)
105
115
106
116
-- TODO: Non-mergejoinable join condition.
107
117
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
108
118
SELECT * FROM frgn AS a, frgn AS b WHERE a.x<b.x;
109
- QUERY PLAN
110
- -----------------------------------------------------
111
- Foreign Scan (actual rows=0 loops=1) (AQO not used)
119
+ QUERY PLAN
120
+ -------------------------------------------
121
+ Foreign Scan (actual rows=0 loops=1)
122
+ AQO not used
112
123
Relations: (frgn a) INNER JOIN (frgn b)
113
124
Using aqo: true
114
125
AQO mode: LEARN
115
126
JOINS: 0
116
- (5 rows)
127
+ (6 rows)
117
128
118
129
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, VERBOSE)
119
130
SELECT * FROM frgn AS a, frgn AS b WHERE a.x<b.x;
120
131
QUERY PLAN
121
132
--------------------------------------------------------------------------------------------------------
122
- Foreign Scan (actual rows=0 loops=1) (AQO not used)
133
+ Foreign Scan (actual rows=0 loops=1)
134
+ AQO not used
123
135
Output: a.x, b.x
124
136
Relations: (public.frgn a) INNER JOIN (public.frgn b)
125
137
Remote SQL: SELECT r1.x, r2.x FROM (public.local r1 INNER JOIN public.local r2 ON (((r1.x < r2.x))))
126
138
Using aqo: true
127
139
AQO mode: LEARN
128
140
JOINS: 0
129
- (7 rows)
141
+ (8 rows)
130
142
131
143
DROP EXTENSION aqo CASCADE;
132
144
DROP EXTENSION postgres_fdw CASCADE;
0 commit comments