@@ -12,7 +12,7 @@ CREATE server multicorn_srv foreign data wrapper multicorn options (
1212 wrapper 'multicorn.testfdw.TestForeignDataWrapper'
1313);
1414CREATE user mapping FOR current_user server multicorn_srv options (usermapping 'test');
15- -- Test for two thing: first, that when a low total row count,
15+ -- Test for two thing: first, that when a low total row count,
1616-- a full seq scan is used on a join.
1717CREATE foreign table testmulticorn (
1818 test1 character varying,
@@ -31,7 +31,7 @@ NOTICE: [('test1', 'character varying'), ('test2', 'character varying')]
3131explain select * from testmulticorn m1 inner join testmulticorn m2 on m1.test1 = m2.test1;
3232 QUERY PLAN
3333-------------------------------------------------------------------------------------
34- Nested Loop (cost=20.00..806.05 rows=2 width=128)
34+ Nested Loop (cost=20.00..806.05 rows=20 width=128)
3535 Join Filter: ((m1.test1)::text = (m2.test1)::text)
3636 -> Foreign Scan on testmulticorn m1 (cost=10.00..400.00 rows=20 width=20)
3737 -> Materialize (cost=10.00..400.10 rows=20 width=20)
@@ -49,40 +49,92 @@ explain select * from testmulticorn m1 left outer join testmulticorn m2 on m1.te
4949(5 rows)
5050
5151DROP foreign table testmulticorn;
52- -- Second, when a total row count is high
52+ -- Second, when a total row count is high
5353-- a parameterized path is used on the test1 attribute.
5454CREATE foreign table testmulticorn (
5555 test1 character varying,
5656 test2 character varying
5757) server multicorn_srv options (
5858 option1 'option1',
59- test_type 'planner'
59+ test_type 'planner',
60+ noisy_explain 'true'
6061);
6162explain select * from testmulticorn;
62- NOTICE: [('option1', 'option1'), ('test_type', 'planner'), ('usermapping', 'test')]
63+ NOTICE: [('noisy_explain', 'true'), (' option1', 'option1'), ('test_type', 'planner'), ('usermapping', 'test')]
6364NOTICE: [('test1', 'character varying'), ('test2', 'character varying')]
65+ NOTICE: EXPLAIN quals=[]
66+ NOTICE: EXPLAIN columns=['test1', 'test2']
67+ NOTICE: EXPLAIN sortkeys=None
68+ NOTICE: EXPLAIN verbose=False
6469 QUERY PLAN
6570----------------------------------------------------------------------------------
6671 Foreign Scan on testmulticorn (cost=10.00..200000000.00 rows=10000000 width=20)
67- (1 row)
72+ Multicorn: EXPLAIN ROW 1
73+ Multicorn: EXPLAIN ROW 2
74+ (3 rows)
6875
6976explain select * from testmulticorn m1 inner join testmulticorn m2 on m1.test1 = m2.test1;
77+ NOTICE: EXPLAIN quals=[]
78+ NOTICE: EXPLAIN columns=['test1', 'test2']
79+ NOTICE: EXPLAIN sortkeys=None
80+ NOTICE: EXPLAIN verbose=False
81+ NOTICE: EXPLAIN quals=[test1 = ?]
82+ NOTICE: EXPLAIN columns=['test1', 'test2']
83+ NOTICE: EXPLAIN sortkeys=None
84+ NOTICE: EXPLAIN verbose=False
7085 QUERY PLAN
7186-------------------------------------------------------------------------------------------
7287 Nested Loop (cost=20.00..400100000.00 rows=500000000000 width=128)
7388 -> Foreign Scan on testmulticorn m1 (cost=10.00..200000000.00 rows=10000000 width=20)
89+ Multicorn: EXPLAIN ROW 1
90+ Multicorn: EXPLAIN ROW 2
7491 -> Foreign Scan on testmulticorn m2 (cost=10.00..20.00 rows=1 width=20)
7592 Filter: ((m1.test1)::text = (test1)::text)
76- (4 rows)
93+ Multicorn: EXPLAIN ROW 1
94+ Multicorn: EXPLAIN ROW 2
95+ (8 rows)
7796
7897explain select * from testmulticorn m1 left outer join testmulticorn m2 on m1.test1 = m2.test1;
98+ NOTICE: EXPLAIN quals=[]
99+ NOTICE: EXPLAIN columns=['test1', 'test2']
100+ NOTICE: EXPLAIN sortkeys=None
101+ NOTICE: EXPLAIN verbose=False
102+ NOTICE: EXPLAIN quals=[test1 = ?]
103+ NOTICE: EXPLAIN columns=['test1', 'test2']
104+ NOTICE: EXPLAIN sortkeys=None
105+ NOTICE: EXPLAIN verbose=False
79106 QUERY PLAN
80107-------------------------------------------------------------------------------------------
81108 Nested Loop Left Join (cost=20.00..400100000.00 rows=500000000000 width=128)
82109 -> Foreign Scan on testmulticorn m1 (cost=10.00..200000000.00 rows=10000000 width=20)
110+ Multicorn: EXPLAIN ROW 1
111+ Multicorn: EXPLAIN ROW 2
83112 -> Foreign Scan on testmulticorn m2 (cost=10.00..20.00 rows=1 width=20)
84113 Filter: ((m1.test1)::text = (test1)::text)
85- (4 rows)
114+ Multicorn: EXPLAIN ROW 1
115+ Multicorn: EXPLAIN ROW 2
116+ (8 rows)
117+
118+ explain select * from testmulticorn m1 left outer join testmulticorn m2 on upper(m1.test1) = m2.test1;
119+ NOTICE: EXPLAIN quals=[]
120+ NOTICE: EXPLAIN columns=['test1', 'test2']
121+ NOTICE: EXPLAIN sortkeys=None
122+ NOTICE: EXPLAIN verbose=False
123+ NOTICE: EXPLAIN quals=[test1 = ?]
124+ NOTICE: EXPLAIN columns=['test1', 'test2']
125+ NOTICE: EXPLAIN sortkeys=None
126+ NOTICE: EXPLAIN verbose=False
127+ QUERY PLAN
128+ -------------------------------------------------------------------------------------------
129+ Nested Loop Left Join (cost=20.00..400100000.00 rows=500000000000 width=128)
130+ -> Foreign Scan on testmulticorn m1 (cost=10.00..200000000.00 rows=10000000 width=20)
131+ Multicorn: EXPLAIN ROW 1
132+ Multicorn: EXPLAIN ROW 2
133+ -> Foreign Scan on testmulticorn m2 (cost=10.00..20.00 rows=1 width=20)
134+ Filter: (upper((m1.test1)::text) = (test1)::text)
135+ Multicorn: EXPLAIN ROW 1
136+ Multicorn: EXPLAIN ROW 2
137+ (8 rows)
86138
87139DROP USER MAPPING FOR current_user SERVER multicorn_srv;
88140DROP EXTENSION multicorn cascade;
0 commit comments