File tree Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,61 @@ select count(*) from tenk1 where thousand > 95;
179179 9040
180180(1 row)
181181
182+ -- test rescan cases too
183+ set enable_material = false;
184+ explain (costs off)
185+ select * from
186+ (select count(unique1) from tenk1 where hundred > 10) ss
187+ right join (values (1),(2),(3)) v(x) on true;
188+ QUERY PLAN
189+ --------------------------------------------------------------------------
190+ Nested Loop Left Join
191+ -> Values Scan on "*VALUES*"
192+ -> Finalize Aggregate
193+ -> Gather
194+ Workers Planned: 4
195+ -> Partial Aggregate
196+ -> Parallel Index Scan using tenk1_hundred on tenk1
197+ Index Cond: (hundred > 10)
198+ (8 rows)
199+
200+ select * from
201+ (select count(unique1) from tenk1 where hundred > 10) ss
202+ right join (values (1),(2),(3)) v(x) on true;
203+ count | x
204+ -------+---
205+ 8900 | 1
206+ 8900 | 2
207+ 8900 | 3
208+ (3 rows)
209+
210+ explain (costs off)
211+ select * from
212+ (select count(*) from tenk1 where thousand > 99) ss
213+ right join (values (1),(2),(3)) v(x) on true;
214+ QUERY PLAN
215+ --------------------------------------------------------------------------------------
216+ Nested Loop Left Join
217+ -> Values Scan on "*VALUES*"
218+ -> Finalize Aggregate
219+ -> Gather
220+ Workers Planned: 4
221+ -> Partial Aggregate
222+ -> Parallel Index Only Scan using tenk1_thous_tenthous on tenk1
223+ Index Cond: (thousand > 99)
224+ (8 rows)
225+
226+ select * from
227+ (select count(*) from tenk1 where thousand > 99) ss
228+ right join (values (1),(2),(3)) v(x) on true;
229+ count | x
230+ -------+---
231+ 9000 | 1
232+ 9000 | 2
233+ 9000 | 3
234+ (3 rows)
235+
236+ reset enable_material;
182237reset enable_seqscan;
183238reset enable_bitmapscan;
184239-- test parallel bitmap heap scan.
Original file line number Diff line number Diff line change @@ -65,6 +65,26 @@ explain (costs off)
6565 select count (* ) from tenk1 where thousand > 95 ;
6666select count (* ) from tenk1 where thousand > 95 ;
6767
68+ -- test rescan cases too
69+ set enable_material = false;
70+
71+ explain (costs off)
72+ select * from
73+ (select count (unique1) from tenk1 where hundred > 10 ) ss
74+ right join (values (1 ),(2 ),(3 )) v(x) on true;
75+ select * from
76+ (select count (unique1) from tenk1 where hundred > 10 ) ss
77+ right join (values (1 ),(2 ),(3 )) v(x) on true;
78+
79+ explain (costs off)
80+ select * from
81+ (select count (* ) from tenk1 where thousand > 99 ) ss
82+ right join (values (1 ),(2 ),(3 )) v(x) on true;
83+ select * from
84+ (select count (* ) from tenk1 where thousand > 99 ) ss
85+ right join (values (1 ),(2 ),(3 )) v(x) on true;
86+
87+ reset enable_material;
6888reset enable_seqscan;
6989reset enable_bitmapscan;
7090
You can’t perform that action at this time.
0 commit comments