pwj_reg.out

application/octet-stream

Filename: pwj_reg.out
Type: application/octet-stream
Part: 0
Message: Re: Partition-wise join for join between (declaratively) partitioned tables
With patch:
explain analyse select * from prt, prt2 where prt.a = prt2.b and prt2.a < 1000;
                                                               QUERY PLAN                                                                
-----------------------------------------------------------------------------------------------------------------------------------------
 Append  (cost=19584.75..488020.65 rows=26071086 width=16) (actual time=569.185..25181.214 rows=26955295 loops=1)
   ->  Hash Join  (cost=19584.75..212972.94 rows=13742869 width=16) (actual time=569.184..95   69.894 rows=14589529 loops=1)
         Hash Cond: (prt2_p1.b = prt_p1.a)
         ->  Bitmap Heap Scan on prt2_p1  (cost=918.67..4594.75 rows=48806 width=8) (actual time=22.149..73.779 rows=47925 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=3054
               ->  Bitmap Index Scan on p221_idx  (cost=0.00..906.47 rows=48806 width=0) (actual time=21.115..21.115 rows=47925 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=10000.48..10000.48 rows=693248 width=8) (actual time=546.388..546.388 rows=693248 loops=1)
               Buckets: 1048576  Batches: 1  Memory Usage: 35272kB
               ->  Seq Scan on prt_p1  (cost=0.00..10000.48 rows=693248 width=8) (actual time=0.034..211.655 rows=693248 loops=1)
   ->  Hash Join  (cost=13085.66..66858.09 rows=4107705 width=16) (actual time=382.009..2840.261 rows=4202400 loops=1)
         Hash Cond: (prt2_p2.b = prt_p2.a)
         ->  Bitmap Heap Scan on prt2_p2  (cost=409.58..2764.42 rows=21827 width=8) (actual time=10.033..37.307 rows=22138 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=2069
               ->  Bitmap Index Scan on p222_idx  (cost=0.00..404.12 rows=21827 width=0) (actual time=9.313..9.313 rows=22138 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=6791.59..6791.59 rows=470759 width=8) (actual time=371.612..371.612 rows=470759 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 22486kB
               ->  Seq Scan on prt_p2  (cost=0.00..6791.59 rows=470759 width=8) (actual time=0.024..144.249 rows=470759 loops=1)
   ->  Hash Join  (cost=10735.94..43088.75 rows=2354076 width=16) (actual time=315.826..1698.220 rows=2363178 loops=1)
         Hash Cond: (prt2_p3.b = prt_p3.a)
         ->  Bitmap Heap Scan on prt2_p3  (cost=286.09..2189.88 rows=15183 width=8) (actual time=9.095..27.502 rows=15148 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=1704
               ->  Bitmap Index Scan on p223_idx  (cost=0.00..282.30 rows=15183 width=0) (actual time=8.555..8.555 rows=15148 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=5598.82..5598.82 rows=388082 width=8) (actual time=306.322..306.322 rows=388082 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 19256kB
               ->  Seq Scan on prt_p3  (cost=0.00..5598.82 rows=388082 width=8) (actual time=0.017..118.992 rows=388082 loops=1)
   ->  Hash Join  (cost=9196.33..29926.69 rows=1525887 width=16) (actual time=270.558..1151.556 rows=1516263 loops=1)
         Hash Cond: (prt2_p4.b = prt_p4.a)
         ->  Bitmap Heap Scan on prt2_p4  (cost=217.14..1839.24 rows=11448 width=8) (actual time=6.128..20.723 rows=11348 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=1471
               ->  Bitmap Index Scan on p224_idx  (cost=0.00..214.28 rows=11448 width=0) (actual time=5.660..5.660 rows=11348 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=4810.75..4810.75 rows=333475 width=8) (actual time=263.874..263.874 rows=333475 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 17123kB
               ->  Seq Scan on prt_p4  (cost=0.00..4810.75 rows=333475 width=8) (actual time=0.019..102.122 rows=333475 loops=1)
   ->  Hash Join  (cost=8048.72..22989.78 rows=1071322 width=16) (actual time=236.195..839.726 rows=1040806 loops=1)
         Hash Cond: (prt2_p5.b = prt_p5.a)
         ->  Bitmap Heap Scan on prt2_p5  (cost=175.43..1585.95 rows=9162 width=8) (actual time=4.535..16.626 rows=8886 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=1284
               ->  Bitmap Index Scan on p225_idx  (cost=0.00..173.14 rows=9162 width=0) (actual time=4.134..4.134 rows=8886 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=4218.13..4218.13 rows=292413 width=8) (actual time=231.193..231.193 rows=292413 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 15519kB
               ->  Seq Scan on prt_p5  (cost=0.00..4218.13 rows=292413 width=8) (actual time=0.017..89.663 rows=292413 loops=1)
   ->  Hash Join  (cost=13580.94..34262.75 rows=1350908 width=16) (actual time=397.409..1191.212 rows=1327879 loops=1)
         Hash Cond: (prt2_p6.b = prt_p6.a)
         ->  Bitmap Heap Scan on prt2_p6  (cost=258.33..2614.14 rows=13665 width=8) (actual time=6.930..26.180 rows=13324 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=2164
               ->  Bitmap Index Scan on p26_idx  (cost=0.00..254.91 rows=13665 width=0) (actual time=6.204..6.204 rows=13324 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=7137.83..7137.83 rows=494783 width=8) (actual time=390.108..390.108 rows=494783 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 23424kB
               ->  Seq Scan on prt_p6  (cost=0.00..7137.83 rows=494783 width=8) (actual time=0.015..151.945 rows=494783 loops=1)
   ->  Hash Join  (cost=5785.85..12242.16 rows=431905 width=16) (actual time=169.720..419.852 rows=430435 loops=1)
         Hash Cond: (prt2_p7.b = prt_p7.a)
         ->  Bitmap Heap Scan on prt2_p7  (cost=100.07..1099.02 rows=5116 width=8) (actual time=3.298..10.899 rows=5077 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=922
               ->  Bitmap Index Scan on p27_idx  (cost=0.00..98.79 rows=5116 width=0) (actual time=3.001..3.001 rows=5077 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=3046.46..3046.46 rows=211146 width=8) (actual time=166.199..166.199 rows=211146 loops=1)
               Buckets: 262144  Batches: 1  Memory Usage: 10296kB
               ->  Seq Scan on prt_p7  (cost=0.00..3046.46 rows=211146 width=8) (actual time=0.016..64.563 rows=211146 loops=1)
   ->  Hash Join  (cost=9971.05..20080.34 rows=599721 width=16) (actual time=293.026..647.043 rows=586940 loops=1)
         Hash Cond: (prt2_p8.b = prt_p8.a)
         ->  Bitmap Heap Scan on prt2_p8  (cost=156.24..1870.16 rows=8234 width=8) (actual time=4.837..17.470 rows=8017 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=1582
               ->  Bitmap Index Scan on p28_idx  (cost=0.00..154.18 rows=8234 width=0) (actual time=4.341..4.341 rows=8017 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=5258.25..5258.25 rows=364525 width=8) (actual time=287.868..287.868 rows=364525 loops=1)
               Buckets: 524288  Batches: 1  Memory Usage: 18336kB
               ->  Seq Scan on prt_p8  (cost=0.00..5258.25 rows=364525 width=8) (actual time=0.015..111.733 rows=364525 loops=1)
   ->  Hash Join  (cost=4276.56..7596.53 rows=202387 width=16) (actual time=125.844..243.889 rows=200772 loops=1)
         Hash Cond: (prt2_p9.b = prt_p9.a)
         ->  Bitmap Heap Scan on prt2_p9  (cost=61.48..799.89 rows=3233 width=8) (actual time=1.802..7.077 rows=3185 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=686
               ->  Bitmap Index Scan on p29_idx  (cost=0.00..60.67 rows=3233 width=0) (actual time=1.599..1.599 rows=3185 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=2258.37..2258.37 rows=156537 width=8) (actual time=123.806..123.806 rows=156537 loops=1)
               Buckets: 262144  Batches: 1  Memory Usage: 8163kB
               ->  Seq Scan on prt_p9  (cost=0.00..2258.37 rows=156537 width=8) (actual time=0.017..48.131 rows=156537 loops=1)
   ->  Nested Loop  (cost=53.69..6135.51 rows=153164 width=16) (actual time=1.659..521.556 rows=160647 loops=1)
         ->  Bitmap Heap Scan on prt2_p10  (cost=53.27..717.89 rows=2690 width=8) (actual time=1.611..6.431 rows=2800 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=625
               ->  Bitmap Index Scan on p210_idx  (cost=0.00..52.59 rows=2690 width=0) (actual time=1.406..1.406 rows=2800 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p10_idx on prt_p10  (cost=0.42..1.44 rows=57 width=8) (actual time=0.015..0.157 rows=57 loops=2800)
               Index Cond: (a = prt2_p10.b)
   ->  Hash Join  (cost=3540.49..5677.93 rows=119392 width=16) (actual time=103.958..177.952 rows=124062 loops=1)
         Hash Cond: (prt2_p11.b = prt_p11.a)
         ->  Bitmap Heap Scan on prt2_p11  (cost=46.27..647.07 rows=2304 width=8) (actual time=1.328..5.480 rows=2389 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=565
               ->  Bitmap Index Scan on p211_idx  (cost=0.00..45.70 rows=2304 width=0) (actual time=1.158..1.158 rows=2389 loops=1)
                     Index Cond: (a < 1000)
         ->  Hash  (cost=1872.43..1872.43 rows=129743 width=8) (actual time=102.515..102.515 rows=129743 loops=1)
               Buckets: 131072  Batches: 1  Memory Usage: 6093kB
               ->  Seq Scan on prt_p11  (cost=0.00..1872.43 rows=129743 width=8) (actual time=0.016..39.956 rows=129743 loops=1)
   ->  Nested Loop  (cost=40.92..4119.50 rows=96382 width=16) (actual time=1.375..347.642 rows=99437 loops=1)
         ->  Bitmap Heap Scan on prt2_p12  (cost=40.50..583.44 rows=2075 width=8) (actual time=1.338..5.369 rows=2126 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=511
               ->  Bitmap Index Scan on p212_idx  (cost=0.00..39.98 rows=2075 width=0) (actual time=1.181..1.181 rows=2126 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p12_idx on prt_p12  (cost=0.42..1.24 rows=46 width=8) (actual time=0.015..0.139 rows=47 loops=2126)
               Index Cond: (a = prt2_p12.b)
   ->  Nested Loop  (cost=39.36..3510.98 rows=78930 width=16) (actual time=1.185..267.274 rows=79101 loops=1)
         ->  Bitmap Heap Scan on prt2_p13  (cost=38.94..527.37 rows=1874 width=8) (actual time=1.159..4.439 rows=1867 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=458
               ->  Bitmap Index Scan on p213_idx  (cost=0.00..38.47 rows=1874 width=0) (actual time=1.032..1.032 rows=1867 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p13_idx on prt_p13  (cost=0.42..1.17 rows=42 width=8) (actual time=0.014..0.121 rows=42 loops=1867)
               Index Cond: (a = prt2_p13.b)
   ->  Nested Loop  (cost=32.93..2631.05 rows=59940 width=16) (actual time=0.881..196.413 rows=60147 loops=1)
         ->  Bitmap Heap Scan on prt2_p14  (cost=32.64..472.55 rows=1593 width=8) (actual time=0.859..3.697 rows=1586 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=409
               ->  Bitmap Index Scan on p214_idx  (cost=0.00..32.24 rows=1593 width=0) (actual time=0.742..0.742 rows=1586 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p14_idx on prt_p14  (cost=0.29..0.97 rows=38 width=8) (actual time=0.012..0.103 rows=38 loops=1586)
               Index Cond: (a = prt2_p14.b)
   ->  Hash Join  (cost=2268.33..4327.76 rows=49069 width=16) (actual time=66.573..119.957 rows=48156 loops=1)
         Hash Cond: (prt2_p21.b = prt_p21.a)
         ->  Seq Scan on prt2_p21  (cost=0.00..1432.05 rows=1458 width=8) (actual time=0.031..26.128 rows=1426 loops=1)
               Filter: (a < 1000)
               Rows Removed by Filter: 83138
         ->  Hash  (cost=1215.37..1215.37 rows=84237 width=8) (actual time=66.383..66.383 rows=84237 loops=1)
               Buckets: 131072  Batches: 1  Memory Usage: 4315kB
               ->  Seq Scan on prt_p21  (cost=0.00..1215.37 rows=84237 width=8) (actual time=0.011..25.719 rows=84237 loops=1)
   ->  Nested Loop  (cost=26.18..1776.13 rows=37233 width=16) (actual time=0.650..120.959 rows=35921 loops=1)
         ->  Bitmap Heap Scan on prt2_p15  (cost=25.89..375.36 rows=1238 width=8) (actual time=0.622..2.807 rows=1185 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=329
               ->  Bitmap Index Scan on p215_idx  (cost=0.00..25.58 rows=1238 width=0) (actual time=0.526..0.526 rows=1185 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p15_idx on prt_p15  (cost=0.29..0.83 rows=30 width=8) (actual time=0.011..0.085 rows=30 loops=1185)
               Index Cond: (a = prt2_p15.b)
   ->  Hash Join  (cost=1786.29..3264.22 rows=27779 width=16) (actual time=52.535..88.490 rows=27595 loops=1)
         Hash Cond: (prt2_p22.b = prt_p22.a)
         ->  Seq Scan on prt2_p22  (cost=0.00..1118.93 rows=1048 width=8) (actual time=0.074..20.310 rows=1043 loops=1)
               Filter: (a < 1000)
               Rows Removed by Filter: 65031
         ->  Hash  (cost=957.24..957.24 rows=66324 width=8) (actual time=52.342..52.342 rows=66324 loops=1)
               Buckets: 131072  Batches: 1  Memory Usage: 3615kB
               ->  Seq Scan on prt_p22  (cost=0.00..957.24 rows=66324 width=8) (actual time=0.010..20.382 rows=66324 loops=1)
   ->  Nested Loop  (cost=19.36..1105.69 rows=20361 width=16) (actual time=0.544..66.442 rows=19896 loops=1)
         ->  Bitmap Heap Scan on prt2_p16  (cost=19.07..289.01 rows=875 width=8) (actual time=0.517..2.051 rows=862 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=245
               ->  Bitmap Index Scan on p216_idx  (cost=0.00..18.85 rows=875 width=0) (actual time=0.440..0.440 rows=862 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p16_idx on prt_p16  (cost=0.29..0.70 rows=23 width=8) (actual time=0.010..0.063 rows=23 loops=862)
               Index Cond: (a = prt2_p16.b)
   ->  Hash Join  (cost=1347.36..2383.93 rows=15184 width=16) (actual time=39.595..63.972 rows=15873 loops=1)
         Hash Cond: (prt2_p23.b = prt_p23.a)
         ->  Seq Scan on prt2_p23  (cost=0.00..842.93 rows=760 width=8) (actual time=0.069..15.294 rows=787 loops=1)
               Filter: (a < 1000)
               Rows Removed by Filter: 48967
         ->  Hash  (cost=722.16..722.16 rows=50016 width=8) (actual time=39.426..39.426 rows=50016 loops=1)
               Buckets: 65536  Batches: 1  Memory Usage: 2466kB
               ->  Seq Scan on prt_p23  (cost=0.00..722.16 rows=50016 width=8) (actual time=0.011..15.314 rows=50016 loops=1)
   ->  Nested Loop  (cost=13.53..698.32 rows=10809 width=16) (actual time=0.323..36.825 rows=10191 loops=1)
         ->  Bitmap Heap Scan on prt2_p17  (cost=13.24..209.23 rows=639 width=8) (actual time=0.299..1.444 rows=610 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=182
               ->  Bitmap Index Scan on p217_idx  (cost=0.00..13.08 rows=639 width=0) (actual time=0.244..0.244 rows=610 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p17_idx on prt_p17  (cost=0.29..0.60 rows=17 width=8) (actual time=0.010..0.050 rows=17 loops=610)
               Index Cond: (a = prt2_p17.b)
   ->  Nested Loop  (cost=12.60..527.52 rows=7242 width=16) (actual time=0.256..27.623 rows=7276 loops=1)
         ->  Bitmap Heap Scan on prt2_p18  (cost=12.31..173.80 rows=519 width=8) (actual time=0.239..1.209 rows=521 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=148
               ->  Bitmap Index Scan on p218_idx  (cost=0.00..12.18 rows=519 width=0) (actual time=0.197..0.197 rows=521 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p18_idx on prt_p18  (cost=0.29..0.54 rows=14 width=8) (actual time=0.009..0.043 rows=14 loops=521)
               Index Cond: (a = prt2_p18.b)
   ->  Hash Join  (cost=757.18..1290.47 rows=4474 width=16) (actual time=22.201..33.434 rows=4442 loops=1)
         Hash Cond: (prt2_p24.b = prt_p24.a)
         ->  Seq Scan on prt2_p24  (cost=0.00..476.11 rows=398 width=8) (actual time=0.047..8.639 rows=396 loops=1)
               Filter: (a < 1000)
               Rows Removed by Filter: 27693
         ->  Hash  (cost=405.97..405.97 rows=28097 width=8) (actual time=22.088..22.088 rows=28097 loops=1)
               Buckets: 32768  Batches: 1  Memory Usage: 1354kB
               ->  Seq Scan on prt_p24  (cost=0.00..405.97 rows=28097 width=8) (actual time=0.010..8.593 rows=28097 loops=1)
   ->  Nested Loop  (cost=7.09..271.57 rows=2748 width=16) (actual time=0.164..12.153 rows=2790 loops=1)
         ->  Bitmap Heap Scan on prt2_p19  (cost=6.80..105.85 rows=324 width=8) (actual time=0.144..0.777 rows=327 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=95
               ->  Bitmap Index Scan on p219_idx  (cost=0.00..6.72 rows=324 width=0) (actual time=0.112..0.112 rows=327 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p19_idx on prt_p19  (cost=0.29..0.43 rows=8 width=8) (actual time=0.009..0.030 rows=9 loops=327)
               Index Cond: (a = prt2_p19.b)
   ->  Nested Loop  (cost=7.02..251.95 rows=1532 width=16) (actual time=0.160..8.164 rows=1505 loops=1)
         ->  Bitmap Heap Scan on prt2_p25  (cost=6.73..116.67 rows=315 width=8) (actual time=0.135..0.780 rows=310 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=100
               ->  Bitmap Index Scan on p235_idx  (cost=0.00..6.65 rows=315 width=0) (actual time=0.107..0.107 rows=310 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p21_idx on prt_p25  (cost=0.29..0.38 rows=5 width=8) (actual time=0.009..0.021 rows=5 loops=310)
               Index Cond: (a = prt2_p25.b)
   ->  Nested Loop  (cost=4.84..30.09 rows=67 width=16) (actual time=0.047..0.512 rows=54 loops=1)
         ->  Bitmap Heap Scan on prt2_p20  (cost=4.56..18.01 rows=36 width=8) (actual time=0.030..0.099 rows=33 loops=1)
               Recheck Cond: (a < 1000)
               Heap Blocks: exact=13
               ->  Bitmap Index Scan on p220_idx  (cost=0.00..4.55 rows=36 width=0) (actual time=0.018..0.018 rows=33 loops=1)
                     Index Cond: (a < 1000)
         ->  Index Scan using p20_idx on prt_p20  (cost=0.28..0.32 rows=2 width=8) (actual time=0.008..0.011 rows=2 loops=33)
               Index Cond: (a = prt2_p20.b)
 Planning time: 18.747 ms
 Execution time: 27525.795 ms
(223 rows)

Without patch:
 explain analyse select * from prt, prt2 where prt.a = prt2.b and prt2.a < 1000;
                                                                  QUERY PLAN                                                                   
-----------------------------------------------------------------------------------------------------------------------------------------------
 Hash Join  (cost=29398.95..533291.62 rows=17045119 width=16) (actual time=442.029..17803.411 rows=26955295 loops=1)
   Hash Cond: (prt_p1.a = prt2_p1.b)
   ->  Append  (cost=0.00..64637.64 rows=4480064 width=8) (actual time=0.015..1691.356 rows=4480064 loops=1)
         ->  Seq Scan on prt_p1  (cost=0.00..10000.48 rows=693248 width=8) (actual time=0.015..154.022 rows=693248 loops=1)
         ->  Seq Scan on prt_p2  (cost=0.00..6791.59 rows=470759 width=8) (actual time=0.076..103.671 rows=470759 loops=1)
         ->  Seq Scan on prt_p3  (cost=0.00..5598.82 rows=388082 width=8) (actual time=0.117..85.043 rows=388082 loops=1)
         ->  Seq Scan on prt_p4  (cost=0.00..4810.75 rows=333475 width=8) (actual time=0.018..72.760 rows=333475 loops=1)
         ->  Seq Scan on prt_p5  (cost=0.00..4218.13 rows=292413 width=8) (actual time=0.019..63.887 rows=292413 loops=1)
         ->  Seq Scan on prt_p6  (cost=0.00..7137.83 rows=494783 width=8) (actual time=0.020..107.839 rows=494783 loops=1)
         ->  Seq Scan on prt_p7  (cost=0.00..3046.46 rows=211146 width=8) (actual time=0.018..46.089 rows=211146 loops=1)
         ->  Seq Scan on prt_p8  (cost=0.00..5258.25 rows=364525 width=8) (actual time=0.015..79.187 rows=364525 loops=1)
         ->  Seq Scan on prt_p9  (cost=0.00..2258.37 rows=156537 width=8) (actual time=0.018..34.031 rows=156537 loops=1)
         ->  Seq Scan on prt_p10  (cost=0.00..2055.80 rows=142480 width=8) (actual time=0.015..30.960 rows=142480 loops=1)
         ->  Seq Scan on prt_p11  (cost=0.00..1872.43 rows=129743 width=8) (actual time=0.017..28.115 rows=129743 loops=1)
         ->  Seq Scan on prt_p12  (cost=0.00..1677.18 rows=116218 width=8) (actual time=0.018..25.164 rows=116218 loops=1)
         ->  Seq Scan on prt_p13  (cost=0.00..1520.95 rows=105395 width=8) (actual time=0.015..22.928 rows=105395 loops=1)
         ->  Seq Scan on prt_p14  (cost=0.00..1358.78 rows=94178 width=8) (actual time=0.013..20.456 rows=94178 loops=1)
         ->  Seq Scan on prt_p21  (cost=0.00..1215.37 rows=84237 width=8) (actual time=0.015..18.363 rows=84237 loops=1)
         ->  Seq Scan on prt_p15  (cost=0.00..1084.95 rows=75195 width=8) (actual time=0.011..16.325 rows=75195 loops=1)
         ->  Seq Scan on prt_p22  (cost=0.00..957.24 rows=66324 width=8) (actual time=0.012..14.430 rows=66324 loops=1)
         ->  Seq Scan on prt_p16  (cost=0.00..839.98 rows=58198 width=8) (actual time=0.012..12.619 rows=58198 loops=1)
         ->  Seq Scan on prt_p23  (cost=0.00..722.16 rows=50016 width=8) (actual time=0.011..10.851 rows=50016 loops=1)
         ->  Seq Scan on prt_p17  (cost=0.00..611.07 rows=42307 width=8) (actual time=0.011..9.172 rows=42307 loops=1)
         ->  Seq Scan on prt_p18  (cost=0.00..504.03 rows=34903 width=8) (actual time=0.010..7.556 rows=34903 loops=1)
         ->  Seq Scan on prt_p24  (cost=0.00..405.97 rows=28097 width=8) (actual time=0.011..6.151 rows=28097 loops=1)
         ->  Seq Scan on prt_p19  (cost=0.00..306.02 rows=21202 width=8) (actual time=0.011..4.590 rows=21202 loops=1)
         ->  Seq Scan on prt_p25  (cost=0.00..343.55 rows=23755 width=8) (actual time=0.010..5.130 rows=23755 loops=1)
         ->  Seq Scan on prt_p20  (cost=0.00..41.48 rows=2848 width=8) (actual time=0.011..0.617 rows=2848 loops=1)
   ->  Hash  (cost=27463.70..27463.70 rows=154820 width=8) (actual time=441.825..441.825 rows=153316 loops=1)
         Buckets: 262144  Batches: 1  Memory Usage: 8037kB
         ->  Append  (cost=918.67..27463.70 rows=154820 width=8) (actual time=21.710..362.367 rows=153316 loops=1)
               ->  Bitmap Heap Scan on prt2_p1  (cost=918.67..4594.75 rows=48806 width=8) (actual time=21.710..66.659 rows=47925 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=3054
                     ->  Bitmap Index Scan on p221_idx  (cost=0.00..906.47 rows=48806 width=0) (actual time=20.696..20.696 rows=47925 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p2  (cost=409.58..2764.42 rows=21827 width=8) (actual time=9.775..33.804 rows=22138 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=2069
                     ->  Bitmap Index Scan on p222_idx  (cost=0.00..404.12 rows=21827 width=0) (actual time=9.075..9.075 rows=22138 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p3  (cost=286.09..2189.88 rows=15183 width=8) (actual time=8.829..27.230 rows=15148 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=1704
                     ->  Bitmap Index Scan on p223_idx  (cost=0.00..282.30 rows=15183 width=0) (actual time=8.303..8.303 rows=15148 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p4  (cost=217.14..1839.24 rows=11448 width=8) (actual time=5.989..20.831 rows=11348 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=1471
                     ->  Bitmap Index Scan on p224_idx  (cost=0.00..214.28 rows=11448 width=0) (actual time=5.532..5.532 rows=11348 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p5  (cost=175.43..1585.95 rows=9162 width=8) (actual time=4.373..17.326 rows=8886 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=1284
                     ->  Bitmap Index Scan on p225_idx  (cost=0.00..173.14 rows=9162 width=0) (actual time=3.979..3.979 rows=8886 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p6  (cost=258.33..2614.14 rows=13665 width=8) (actual time=6.783..27.563 rows=13324 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=2164
                     ->  Bitmap Index Scan on p26_idx  (cost=0.00..254.91 rows=13665 width=0) (actual time=6.071..6.071 rows=13324 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p7  (cost=100.07..1099.02 rows=5116 width=8) (actual time=3.191..10.829 rows=5077 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=922
                     ->  Bitmap Index Scan on p27_idx  (cost=0.00..98.79 rows=5116 width=0) (actual time=2.888..2.888 rows=5077 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p8  (cost=156.24..1870.16 rows=8234 width=8) (actual time=4.723..17.380 rows=8017 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=1582
                     ->  Bitmap Index Scan on p28_idx  (cost=0.00..154.18 rows=8234 width=0) (actual time=4.233..4.233 rows=8017 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p9  (cost=61.48..799.89 rows=3233 width=8) (actual time=1.721..7.017 rows=3185 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=686
                     ->  Bitmap Index Scan on p29_idx  (cost=0.00..60.67 rows=3233 width=0) (actual time=1.525..1.525 rows=3185 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p10  (cost=53.27..717.89 rows=2690 width=8) (actual time=1.533..6.314 rows=2800 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=625
                     ->  Bitmap Index Scan on p210_idx  (cost=0.00..52.59 rows=2690 width=0) (actual time=1.352..1.352 rows=2800 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p11  (cost=46.27..647.07 rows=2304 width=8) (actual time=1.283..5.482 rows=2389 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=565
                     ->  Bitmap Index Scan on p211_idx  (cost=0.00..45.70 rows=2304 width=0) (actual time=1.121..1.121 rows=2389 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p12  (cost=40.50..583.44 rows=2075 width=8) (actual time=1.258..5.192 rows=2126 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=511
                     ->  Bitmap Index Scan on p212_idx  (cost=0.00..39.98 rows=2075 width=0) (actual time=1.105..1.105 rows=2126 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p13  (cost=38.94..527.37 rows=1874 width=8) (actual time=1.127..4.752 rows=1867 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=458
                     ->  Bitmap Index Scan on p213_idx  (cost=0.00..38.47 rows=1874 width=0) (actual time=1.004..1.004 rows=1867 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p14  (cost=32.64..472.55 rows=1593 width=8) (actual time=0.846..4.018 rows=1586 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=409
                     ->  Bitmap Index Scan on p214_idx  (cost=0.00..32.24 rows=1593 width=0) (actual time=0.729..0.729 rows=1586 loops=1)
                           Index Cond: (a < 1000)
               ->  Seq Scan on prt2_p21  (cost=0.00..1432.05 rows=1458 width=8) (actual time=0.034..27.194 rows=1426 loops=1)
                     Filter: (a < 1000)
                     Rows Removed by Filter: 83138
               ->  Bitmap Heap Scan on prt2_p15  (cost=25.89..375.36 rows=1238 width=8) (actual time=0.592..2.915 rows=1185 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=329
                     ->  Bitmap Index Scan on p215_idx  (cost=0.00..25.58 rows=1238 width=0) (actual time=0.500..0.500 rows=1185 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p16  (cost=19.07..289.01 rows=875 width=8) (actual time=0.473..2.058 rows=862 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=245
                     ->  Bitmap Index Scan on p216_idx  (cost=0.00..18.85 rows=875 width=0) (actual time=0.407..0.407 rows=862 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p17  (cost=13.24..209.23 rows=639 width=8) (actual time=0.283..1.456 rows=610 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=182
                     ->  Bitmap Index Scan on p217_idx  (cost=0.00..13.08 rows=639 width=0) (actual time=0.235..0.235 rows=610 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p18  (cost=12.31..173.80 rows=519 width=8) (actual time=0.239..1.222 rows=521 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=148
                     ->  Bitmap Index Scan on p218_idx  (cost=0.00..12.18 rows=519 width=0) (actual time=0.199..0.199 rows=521 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p19  (cost=6.80..105.85 rows=324 width=8) (actual time=0.137..0.773 rows=327 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=95
                     ->  Bitmap Index Scan on p219_idx  (cost=0.00..6.72 rows=324 width=0) (actual time=0.109..0.109 rows=327 loops=1)
                           Index Cond: (a < 1000)
               ->  Bitmap Heap Scan on prt2_p20  (cost=4.56..18.01 rows=36 width=8) (actual time=0.027..0.101 rows=33 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=13
                     ->  Bitmap Index Scan on p220_idx  (cost=0.00..4.55 rows=36 width=0) (actual time=0.016..0.016 rows=33 loops=1)
                           Index Cond: (a < 1000)
               ->  Seq Scan on prt2_p22  (cost=0.00..1118.93 rows=1048 width=8) (actual time=0.070..21.266 rows=1043 loops=1)
                     Filter: (a < 1000)
                     Rows Removed by Filter: 65031
               ->  Seq Scan on prt2_p23  (cost=0.00..842.93 rows=760 width=8) (actual time=0.063..15.989 rows=787 loops=1)
                     Filter: (a < 1000)
                     Rows Removed by Filter: 48967
               ->  Seq Scan on prt2_p24  (cost=0.00..476.11 rows=398 width=8) (actual time=0.040..9.024 rows=396 loops=1)
                     Filter: (a < 1000)
                     Rows Removed by Filter: 27693
               ->  Bitmap Heap Scan on prt2_p25  (cost=6.73..116.67 rows=315 width=8) (actual time=0.137..0.830 rows=310 loops=1)
                     Recheck Cond: (a < 1000)
                     Heap Blocks: exact=100
                     ->  Bitmap Index Scan on p235_idx  (cost=0.00..6.65 rows=315 width=0) (actual time=0.109..0.109 rows=310 loops=1)
                           Index Cond: (a < 1000)
 Planning time: 6.722 ms
 Execution time: 20054.804 ms
(150 rows)