@@ -621,6 +621,10 @@ begin
621621perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Relation Name')::text,
622622 '"runtime_test_1_1"',
623623 'wrong partition');
624+
625+ select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans') into num;
626+ perform test.pathman_equal(num::text, '2', 'expected 2 child plans for custom scan');
627+
624628return 'ok';
625629end;
626630$$ language plpgsql;
@@ -629,7 +633,7 @@ declare
629633plan jsonb;
630634num int;
631635begin
632- plan = test.pathman_test('select * from test.runtime_test_1 where id = any (select * from test.run_values limit6 )');
636+ plan = test.pathman_test('select * from test.runtime_test_1 where id = any (select * from test.run_values limit4 )');
633637
634638perform test.pathman_equal((plan->0->'Plan'->'Node Type')::text,
635639 '"Nested Loop"',
@@ -644,9 +648,9 @@ begin
644648 'wrong plan provider');
645649
646650select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans') into num;
647- perform test.pathman_equal(num::text, '6 ', 'expected6 child plans for custom scan');
651+ perform test.pathman_equal(num::text, '4 ', 'expected4 child plans for custom scan');
648652
649- for i in 0..5 loop
653+ for i in 0..3 loop
650654perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Plans'->i->'Relation Name')::text,
651655 format('"runtime_test_1_%s"', i + 1),
652656 'wrong partition');
@@ -678,11 +682,11 @@ begin
678682 'wrong plan provider');
679683
680684select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans') into num;
681- perform test.pathman_equal(num::text, '128 ', 'expected128 child plans for custom scan');
685+ perform test.pathman_equal(num::text, '6 ', 'expected6 child plans for custom scan');
682686
683- for i in 0..127 loop
687+ for i in 0..5 loop
684688num = plan->0->'Plan'->'Plans'->1->'Plans'->i->'Actual Loops';
685- perform test.pathman_assert(num <=79 , 'expected no more than79 loops');
689+ perform test.pathman_assert(num> 0 and num <=1667 , 'expected no more than1667 loops');
686690end loop;
687691
688692return 'ok';
@@ -694,7 +698,7 @@ declare
694698num int;
695699begin
696700plan = test.pathman_test('select * from test.category c, lateral' ||
697- '(select * from test.runtime_test_2 g where g.category_id = c.id order by rating limit10 ) as tg');
701+ '(select * from test.runtime_test_2 g where g.category_id = c.id order by rating limit4 ) as tg');
698702
699703perform test.pathman_equal((plan->0->'Plan'->'Node Type')::text,
700704 '"Nested Loop"',
@@ -710,9 +714,9 @@ begin
710714 'wrong plan provider');
711715
712716select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans'->0->'Plans') into num;
713- perform test.pathman_equal(num::text, '10 ', 'expected10 child plans for custom scan');
717+ perform test.pathman_equal(num::text, '4 ', 'expected4 child plans for custom scan');
714718
715- for i in 0..9 loop
719+ for i in 0..3 loop
716720perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Plans'->0->'Plans'->i->'Relation Name')::text,
717721 format('"runtime_test_2_%s"', i + 1),
718722 'wrong partition');
@@ -727,26 +731,26 @@ $$ language plpgsql;
727731create table test.run_values as select generate_series(1, 10000) val;
728732create table test.runtime_test_1(id serial primary key, val real);
729733insert into test.runtime_test_1 select generate_series(1, 10000), random();
730- select pathman.create_hash_partitions('test.runtime_test_1', 'id',128 );
734+ select pathman.create_hash_partitions('test.runtime_test_1', 'id',6 );
731735NOTICE: function test.runtime_test_1_insert_trigger_func() does not exist, skipping
732736NOTICE: function test.runtime_test_1_update_trigger_func() does not exist, skipping
733737NOTICE: Copying data to partitions...
734738 create_hash_partitions
735739------------------------
736- 128
740+ 6
737741(1 row)
738742
739- create table test.category as (select id, 'cat' || id::text as name from generate_series(1,10 ) id);
743+ create table test.category as (select id, 'cat' || id::text as name from generate_series(1,4 ) id);
740744create table test.runtime_test_2 (id serial, category_id int not null, name text, rating real);
741- insert into test.runtime_test_2 (select id, (id %10 ) + 1 as category_id, 'good' || id::text as name, random() as rating from generate_series(1,1000000 ) id);
745+ insert into test.runtime_test_2 (select id, (id %6 ) + 1 as category_id, 'good' || id::text as name, random() as rating from generate_series(1,100000 ) id);
742746create index on test.runtime_test_2 (category_id, rating);
743- select pathman.create_hash_partitions('test.runtime_test_2', 'category_id',128 );
747+ select pathman.create_hash_partitions('test.runtime_test_2', 'category_id',6 );
744748NOTICE: function test.runtime_test_2_insert_trigger_func() does not exist, skipping
745749NOTICE: function test.runtime_test_2_update_trigger_func() does not exist, skipping
746750NOTICE: Copying data to partitions...
747751 create_hash_partitions
748752------------------------
749- 128
753+ 6
750754(1 row)
751755
752756analyze test.run_values;
@@ -784,7 +788,7 @@ set pg_pathman.enable_runtimemergeappend = off;
784788set enable_mergejoin = on;
785789set enable_hashjoin = on;
786790drop table test.run_values, test.runtime_test_1, test.runtime_test_2 cascade;
787- NOTICE: drop cascades to256 other objects
791+ NOTICE: drop cascades to12 other objects
788792/*
789793 * Test split and merge
790794 */