queries.sql

application/octet-stream

Filename: queries.sql
Type: application/octet-stream
Part: 1
Message: Re: Partition-wise join for join between (declaratively) partitioned tables
select count(*), tableoid::regclass from prt group by tableoid::regclass;
select count(*), tableoid::regclass from prt2 group by tableoid::regclass;

set work_mem = '1GB';
set enable_partition_wise_join to false;

explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;

set enable_partition_wise_join to true;

explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt t1, prt2 t2 where t1.a = t2.b and t2.a > 8000;


explain analyse  select * from prt_p1 t1, prt2_p1 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p2 t1, prt2_p2 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p3 t1, prt2_p3 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p4 t1, prt2_p4 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p5 t1, prt2_p5 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p6 t1, prt2_p6 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p7 t1, prt2_p7 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p8 t1, prt2_p8 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p9 t1, prt2_p9 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p10 t1, prt2_p10 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p11 t1, prt2_p11 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p12 t1, prt2_p12 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p13 t1, prt2_p13 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p14 t1, prt2_p14 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p15 t1, prt2_p15 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p16 t1, prt2_p16 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p17 t1, prt2_p17 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p18 t1, prt2_p18 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p19 t1, prt2_p19 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p20 t1, prt2_p20 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p21 t1, prt2_p21 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p22 t1, prt2_p22 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p23 t1, prt2_p23 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p24 t1, prt2_p24 t2 where t1.a = t2.b and t2.a > 8000;
explain analyse  select * from prt_p25 t1, prt2_p25 t2 where t1.a = t2.b and t2.a > 8000;