Skip to content

Commit e90d686

Browse files
committed
more tests for RuntimeAppend
1 parent d57501d commit e90d686

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

expected/pathman_runtime_nodes.out

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,93 @@ select test.pathman_test_5(); /* projection tests for RuntimeXXX nodes */
285285
ok
286286
(1 row)
287287

288+
/* RuntimeAppend (join, enabled parent) */
289+
select pathman.set_enable_parent('test.runtime_test_1', true);
290+
set_enable_parent
291+
-------------------
292+
293+
(1 row)
294+
295+
explain (costs off)
296+
select from test.runtime_test_1 as t1
297+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
298+
QUERY PLAN
299+
--------------------------------------------------------------------------------
300+
Nested Loop
301+
-> Limit
302+
-> Seq Scan on run_values
303+
-> Custom Scan (RuntimeAppend)
304+
-> Index Only Scan using runtime_test_1_pkey on runtime_test_1 t1
305+
Filter: (run_values.val = id)
306+
-> Index Only Scan using runtime_test_1_0_pkey on runtime_test_1_0 t1
307+
Index Cond: (id = run_values.val)
308+
-> Index Only Scan using runtime_test_1_1_pkey on runtime_test_1_1 t1
309+
Index Cond: (id = run_values.val)
310+
-> Index Only Scan using runtime_test_1_2_pkey on runtime_test_1_2 t1
311+
Index Cond: (id = run_values.val)
312+
-> Index Only Scan using runtime_test_1_3_pkey on runtime_test_1_3 t1
313+
Index Cond: (id = run_values.val)
314+
-> Index Only Scan using runtime_test_1_4_pkey on runtime_test_1_4 t1
315+
Index Cond: (id = run_values.val)
316+
-> Index Only Scan using runtime_test_1_5_pkey on runtime_test_1_5 t1
317+
Index Cond: (id = run_values.val)
318+
(18 rows)
319+
320+
select from test.runtime_test_1 as t1
321+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
322+
--
323+
(4 rows)
324+
325+
/* RuntimeAppend (join, disabled parent) */
326+
select pathman.set_enable_parent('test.runtime_test_1', false);
327+
set_enable_parent
328+
-------------------
329+
330+
(1 row)
331+
332+
explain (costs off)
333+
select from test.runtime_test_1 as t1
334+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
335+
QUERY PLAN
336+
--------------------------------------------------------------------------------
337+
Nested Loop
338+
-> Limit
339+
-> Seq Scan on run_values
340+
-> Custom Scan (RuntimeAppend)
341+
-> Index Only Scan using runtime_test_1_0_pkey on runtime_test_1_0 t1
342+
Index Cond: (id = run_values.val)
343+
-> Index Only Scan using runtime_test_1_1_pkey on runtime_test_1_1 t1
344+
Index Cond: (id = run_values.val)
345+
-> Index Only Scan using runtime_test_1_2_pkey on runtime_test_1_2 t1
346+
Index Cond: (id = run_values.val)
347+
-> Index Only Scan using runtime_test_1_3_pkey on runtime_test_1_3 t1
348+
Index Cond: (id = run_values.val)
349+
-> Index Only Scan using runtime_test_1_4_pkey on runtime_test_1_4 t1
350+
Index Cond: (id = run_values.val)
351+
-> Index Only Scan using runtime_test_1_5_pkey on runtime_test_1_5 t1
352+
Index Cond: (id = run_values.val)
353+
(16 rows)
354+
355+
select from test.runtime_test_1 as t1
356+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
357+
--
358+
(4 rows)
359+
360+
/* RuntimeAppend (join, additional projections) */
361+
select generate_series(1, 2) from test.runtime_test_1 as t1
362+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
363+
generate_series
364+
-----------------
365+
1
366+
2
367+
1
368+
2
369+
1
370+
2
371+
1
372+
2
373+
(8 rows)
374+
288375
DROP SCHEMA test CASCADE;
289376
NOTICE: drop cascades to 30 other objects
290377
DROP EXTENSION pg_pathman CASCADE;

sql/pathman_runtime_nodes.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,31 @@ select test.pathman_test_4(); /* RuntimeMergeAppend (lateral) */
266266
select test.pathman_test_5(); /* projection tests for RuntimeXXX nodes */
267267

268268

269+
/* RuntimeAppend (join, enabled parent) */
270+
select pathman.set_enable_parent('test.runtime_test_1', true);
271+
272+
explain (costs off)
273+
select from test.runtime_test_1 as t1
274+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
275+
276+
select from test.runtime_test_1 as t1
277+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
278+
279+
/* RuntimeAppend (join, disabled parent) */
280+
select pathman.set_enable_parent('test.runtime_test_1', false);
281+
282+
explain (costs off)
283+
select from test.runtime_test_1 as t1
284+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
285+
286+
select from test.runtime_test_1 as t1
287+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
288+
289+
/* RuntimeAppend (join, additional projections) */
290+
select generate_series(1, 2) from test.runtime_test_1 as t1
291+
join (select * from test.run_values limit 4) as t2 on t1.id = t2.val;
292+
293+
269294
DROP SCHEMA test CASCADE;
270295
DROP EXTENSION pg_pathman CASCADE;
271296
DROP SCHEMA pathman CASCADE;

0 commit comments

Comments
 (0)