explain analyse select * from prt, prt2 where prt.a = prt2.b and prt2.a > 8000; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- Merge Join (cost=56528.93..5764588.12 rows=357011304 width=16) (actual time=285.929..112822.888 rows=359419719 loops=1) Merge Cond: (prt2.b = prt.a) -> Merge Append (cost=22123.03..184845.50 rows=3257656 width=8) (actual time=129.289..7001.321 rows=3258009 loops=1) Sort Key: prt2.b -> Sort (cost=0.01..0.02 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1) Sort Key: prt2.b Sort Method: quicksort Memory: 25kB -> Seq Scan on prt2 (cost=0.00..0.00 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1) Filter: (a > 8000) -> Index Scan using np221_idx on prt2_p1 (cost=0.42..12616.76 rows=313782 width=8) (actual time=0.054..1144.689 rows=314494 loops=1) Filter: (a > 8000) Rows Removed by Filter: 378056 -> Index Scan using np222_idx on prt2_p2 (cost=0.42..8593.25 rows=293627 width=8) (actual time=0.024..744.252 rows=293729 loops=1) Filter: (a > 8000) Rows Removed by Filter: 177949 -> Index Scan using np223_idx on prt2_p3 (cost=0.42..7055.39 rows=265279 width=8) (actual time=0.031..592.854 rows=266162 loops=1) Filter: (a > 8000) Rows Removed by Filter: 121098 -> Index Scan using np224_idx on prt2_p4 (cost=0.42..6061.02 rows=242640 width=8) (actual time=0.023..504.286 rows=242756 loops=1) Filter: (a > 8000) Rows Removed by Filter: 89917 -> Index Scan using np225_idx on prt2_p5 (cost=0.42..5340.06 rows=222789 width=8) (actual time=0.023..457.468 rows=221372 loops=1) Filter: (a > 8000) Rows Removed by Filter: 71732 -> Index Scan using np26_idx on prt2_p6 (cost=0.42..9026.17 rows=388005 width=8) (actual time=0.024..760.573 rows=388880 loops=1) Filter: (a > 8000) Rows Removed by Filter: 106563 -> Index Scan using np27_idx on prt2_p7 (cost=0.42..3857.10 rows=171019 width=8) (actual time=0.022..284.530 rows=171000 loops=1) Filter: (a > 8000) Rows Removed by Filter: 40690 -> Index Scan using np28_idx on prt2_p8 (cost=0.42..6622.39 rows=300013 width=8) (actual time=0.036..511.425 rows=299361 loops=1) Filter: (a > 8000) Rows Removed by Filter: 64128 -> Index Scan using np29_idx on prt2_p9 (cost=0.42..2864.07 rows=131012 width=8) (actual time=0.023..191.341 rows=131315 loops=1) Filter: (a > 8000) Rows Removed by Filter: 25865 -> Index Scan using np210_idx on prt2_p10 (cost=0.42..2602.44 rows=120568 width=8) (actual time=0.020..173.758 rows=120330 loops=1) Filter: (a > 8000) Rows Removed by Filter: 22486 -> Index Scan using np211_idx on prt2_p11 (cost=0.42..2346.33 rows=109560 width=8) (actual time=0.020..154.743 rows=109297 loops=1) Filter: (a > 8000) Rows Removed by Filter: 19462 -> Index Scan using np212_idx on prt2_p12 (cost=0.42..2126.79 rows=99635 width=8) (actual time=0.019..140.172 rows=99686 loops=1) Filter: (a > 8000) Rows Removed by Filter: 17021 -> Index Scan using np213_idx on prt2_p13 (cost=0.42..1925.10 rows=90585 width=8) (actual time=0.020..122.196 rows=90710 loops=1) Filter: (a > 8000) Rows Removed by Filter: 14923 -> Index Scan using np214_idx on prt2_p14 (cost=0.29..1717.09 rows=81355 width=8) (actual time=0.015..107.828 rows=81339 loops=1) Filter: (a > 8000) Rows Removed by Filter: 12894 -> Sort (cost=7367.85..7551.45 rows=73441 width=8) (actual time=44.293..64.899 rows=73352 loops=1) Sort Key: prt2_p21.b Sort Method: quicksort Memory: 7084kB -> Seq Scan on prt2_p21 (cost=0.00..1432.24 rows=73441 width=8) (actual time=0.010..16.525 rows=73352 loops=1) Filter: (a > 8000) Rows Removed by Filter: 11227 -> Index Scan using np215_idx on prt2_p15 (cost=0.29..1369.05 rows=65327 width=8) (actual time=0.062..80.022 rows=65345 loops=1) Filter: (a > 8000) Rows Removed by Filter: 9778 -> Index Scan using np216_idx on prt2_p16 (cost=0.29..1056.53 rows=51070 width=8) (actual time=0.029..59.202 rows=51004 loops=1) Filter: (a > 8000) Rows Removed by Filter: 6964 -> Index Scan using np217_idx on prt2_p17 (cost=0.29..764.48 rows=37061 width=8) (actual time=0.030..43.427 rows=37063 loops=1) Filter: (a > 8000) Rows Removed by Filter: 4872 -> Index Scan using np218_idx on prt2_p18 (cost=0.29..633.67 rows=30879 width=8) (actual time=0.192..35.353 rows=30844 loops=1) Filter: (a > 8000) Rows Removed by Filter: 3915 -> Index Scan using np219_idx on prt2_p19 (cost=0.29..388.25 rows=18997 width=8) (actual time=0.029..20.644 rows=18995 loops=1) Filter: (a > 8000) Rows Removed by Filter: 2283 -> Index Scan using np220_idx on prt2_p20 (cost=0.28..51.36 rows=2499 width=8) (actual time=0.028..2.038 rows=2492 loops=1) Filter: (a > 8000) Rows Removed by Filter: 292 -> Sort (cost=5743.00..5888.83 rows=58330 width=8) (actual time=40.710..56.775 rows=58244 loops=1) Sort Key: prt2_p22.b Sort Method: quicksort Memory: 4722kB -> Seq Scan on prt2_p22 (cost=0.00..1125.61 rows=58330 width=8) (actual time=0.016..17.166 rows=58244 loops=1) Filter: (a > 8000) Rows Removed by Filter: 8205 -> Sort (cost=4268.59..4379.27 rows=44272 width=8) (actual time=30.790..43.002 rows=44320 loops=1) Sort Key: prt2_p23.b Sort Method: quicksort Memory: 3960kB -> Seq Scan on prt2_p23 (cost=0.00..852.10 rows=44272 width=8) (actual time=0.037..13.976 rows=44320 loops=1) Filter: (a > 8000) Rows Removed by Filter: 6008 -> Sort (cost=2276.48..2338.29 rows=24725 width=8) (actual time=12.700..19.211 rows=24731 loops=1) Sort Key: prt2_p24.b Sort Method: quicksort Memory: 2121kB -> Seq Scan on prt2_p24 (cost=0.00..472.34 rows=24725 width=8) (actual time=0.018..5.053 rows=24731 loops=1) Filter: (a > 8000) Rows Removed by Filter: 3136 -> Index Scan using np235_idx on prt2_p25 (cost=0.29..433.67 rows=21185 width=8) (actual time=0.038..22.767 rows=21188 loops=1) Filter: (a > 8000) Rows Removed by Filter: 2588 -> Materialize (cost=34300.59..227684.00 rows=4480065 width=8) (actual time=156.634..26727.823 rows=359421112 loops=1) -> Merge Append (cost=34300.59..216483.83 rows=4480065 width=8) (actual time=156.630..6343.989 rows=4480064 loops=1) Sort Key: prt.a -> Sort (cost=0.01..0.02 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1) Sort Key: prt.a Sort Method: quicksort Memory: 25kB -> Seq Scan on prt (cost=0.00..0.00 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1) -> Index Scan using p1_idx on prt_p1 (cost=0.42..10892.83 rows=693027 width=8) (actual time=0.033..975.367 rows=693027 loops=1) -> Index Scan using p2_idx on prt_p2 (cost=0.42..7409.45 rows=471395 width=8) (actual time=0.027..640.708 rows=471395 loops=1) -> Index Scan using p3_idx on prt_p3 (cost=0.42..6091.59 rows=387541 width=8) (actual time=0.027..513.921 rows=387541 loops=1) -> Index Scan using p4_idx on prt_p4 (cost=0.42..5241.38 rows=333435 width=8) (actual time=0.026..437.525 rows=333435 loops=1) -> Index Scan using p5_idx on prt_p5 (cost=0.42..4593.79 rows=292237 width=8) (actual time=0.026..390.688 rows=292237 loops=1) -> Index Scan using p6_idx on prt_p6 (cost=0.42..7788.65 rows=495522 width=8) (actual time=0.025..663.704 rows=495522 loops=1) -> Index Scan using p7_idx on prt_p7 (cost=0.42..3304.72 rows=210213 width=8) (actual time=0.022..249.065 rows=210213 loops=1) -> Index Scan using p8_idx on prt_p8 (cost=0.42..5728.35 rows=364424 width=8) (actual time=0.023..457.597 rows=364424 loops=1) -> Index Scan using p9_idx on prt_p9 (cost=0.42..2474.48 rows=157389 width=8) (actual time=0.020..168.681 rows=157389 loops=1) -> Index Scan using p10_idx on prt_p10 (cost=0.42..2227.66 rows=141686 width=8) (actual time=0.021..153.887 rows=141686 loops=1) -> Sort (cost=12821.36..13144.09 rows=129090 width=8) (actual time=56.606..95.076 rows=129090 loops=1) Sort Key: prt_p11.a Sort Method: quicksort Memory: 10132kB -> Seq Scan on prt_p11 (cost=0.00..1862.90 rows=129090 width=8) (actual time=0.009..14.665 rows=129090 loops=1) -> Index Scan using p12_idx on prt_p12 (cost=0.42..1836.05 rows=116767 width=8) (actual time=0.069..121.843 rows=116767 loops=1) -> Index Scan using p13_idx on prt_p13 (cost=0.42..1655.09 rows=105258 width=8) (actual time=0.039..106.896 rows=105258 loops=1) -> Index Scan using p14_idx on prt_p14 (cost=0.29..1489.18 rows=94719 width=8) (actual time=0.025..95.627 rows=94719 loops=1) -> Sort (cost=8112.32..8323.05 rows=84292 width=8) (actual time=37.597..60.504 rows=84292 loops=1) Sort Key: prt_p21.a Sort Method: quicksort Memory: 7682kB -> Seq Scan on prt_p21 (cost=0.00..1215.92 rows=84292 width=8) (actual time=0.015..10.106 rows=84292 loops=1) -> Index Scan using p15_idx on prt_p15 (cost=0.29..1185.09 rows=75372 width=8) (actual time=0.041..70.705 rows=75372 loops=1) -> Sort (cost=6287.78..6454.05 rows=66508 width=8) (actual time=29.056..46.993 rows=66508 loops=1) Sort Key: prt_p22.a Sort Method: quicksort Memory: 6710kB -> Seq Scan on prt_p22 (cost=0.00..960.08 rows=66508 width=8) (actual time=0.012..7.792 rows=66508 loops=1) -> Index Scan using p16_idx on prt_p16 (cost=0.29..914.16 rows=58131 width=8) (actual time=0.032..52.574 rows=58131 loops=1) -> Sort (cost=4600.27..4724.66 rows=49757 width=8) (actual time=21.108..34.750 rows=49757 loops=1) Sort Key: prt_p23.a Sort Method: quicksort Memory: 4258kB -> Seq Scan on prt_p23 (cost=0.00..718.57 rows=49757 width=8) (actual time=0.010..5.216 rows=49757 loops=1) -> Index Scan using p17_idx on prt_p17 (cost=0.29..663.16 rows=42158 width=8) (actual time=0.033..39.487 rows=42158 loops=1) -> Index Scan using p18_idx on prt_p18 (cost=0.29..552.88 rows=35139 width=8) (actual time=0.019..31.623 rows=35139 loops=1) -> Sort (cost=2470.87..2540.84 rows=27985 width=8) (actual time=11.652..18.673 rows=27985 loops=1) Sort Key: prt_p24.a Sort Method: quicksort Memory: 2299kB -> Seq Scan on prt_p24 (cost=0.00..403.85 rows=27985 width=8) (actual time=0.010..2.970 rows=27985 loops=1) -> Index Scan using p19_idx on prt_p19 (cost=0.29..334.77 rows=21259 width=8) (actual time=0.027..18.496 rows=21259 loops=1) -> Index Scan using p21_idx on prt_p25 (cost=0.29..375.90 rows=23878 width=8) (actual time=0.018..20.479 rows=23878 loops=1) -> Index Scan using p20_idx on prt_p20 (cost=0.28..45.81 rows=2882 width=8) (actual time=0.017..1.903 rows=2882 loops=1) Planning time: 2.881 ms Execution time: 126177.337 ms (145 rows) explain analyse select * from prt, prt2 where prt.a = prt2.b and prt2.a > 8000; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- Append (cost=18660.53..4953710.21 rows=360163968 width=16) (actual time=279.233..152264.278 rows=359419719 loops=1) -> Hash Join (cost=18660.53..1240187.40 rows=88852511 width=16) (actual time=279.232..31712.963 rows=87358315 loops=1) Hash Cond: (prt2_p1.b = prt_p1.a) -> Index Scan using p221_idx on prt2_p1 (cost=0.42..5884.45 rows=313782 width=8) (actual time=0.033..661.448 rows=314494 loops=1) Index Cond: (a > 8000) -> Hash (cost=9997.27..9997.27 rows=693027 width=8) (actual time=276.527..276.527 rows=693027 loops=1) Buckets: 1048576 Batches: 1 Memory Usage: 35264kB -> Seq Scan on prt_p1 (cost=0.00..9997.27 rows=693027 width=8) (actual time=0.018..110.729 rows=693027 loops=1) -> Hash Join (cost=12692.81..722229.46 rows=55325775 width=16) (actual time=173.476..20107.718 rows=55504542 loops=1) Hash Cond: (prt2_p2.b = prt_p2.a) -> Index Scan using p222_idx on prt2_p2 (cost=0.42..5428.45 rows=293627 width=8) (actual time=0.053..564.156 rows=293729 loops=1) Index Cond: (a > 8000) -> Hash (cost=6799.95..6799.95 rows=471395 width=8) (actual time=172.367..172.367 rows=471395 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 22510kB -> Seq Scan on prt_p2 (cost=0.00..6799.95 rows=471395 width=8) (actual time=0.023..68.280 rows=471395 loops=1) -> Hash Join (cost=10435.09..555276.33 rows=41063064 width=16) (actual time=136.662..14974.080 rows=41314245 loops=1) Hash Cond: (prt2_p3.b = prt_p3.a) -> Index Scan using p223_idx on prt2_p3 (cost=0.42..4887.51 rows=265279 width=8) (actual time=0.052..489.116 rows=266162 loops=1) Index Cond: (a > 8000) -> Hash (cost=5590.41..5590.41 rows=387541 width=8) (actual time=135.402..135.402 rows=387541 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 19235kB -> Seq Scan on prt_p3 (cost=0.00..5590.41 rows=387541 width=8) (actual time=0.023..55.798 rows=387541 loops=1) -> Hash Join (cost=8978.71..428551.82 rows=32351597 width=16) (actual time=126.169..10983.116 rows=32409109 loops=1) Hash Cond: (prt2_p4.b = prt_p4.a) -> Index Scan using p224_idx on prt2_p4 (cost=0.42..4460.96 rows=242640 width=8) (actual time=0.051..385.778 rows=242756 loops=1) Index Cond: (a > 8000) -> Hash (cost=4810.35..4810.35 rows=333435 width=8) (actual time=118.626..118.626 rows=333435 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 17121kB -> Seq Scan on prt_p4 (cost=0.00..4810.35 rows=333435 width=8) (actual time=0.031..48.748 rows=333435 loops=1) -> Hash Join (cost=7869.75..346197.94 rows=26043950 width=16) (actual time=101.022..8797.645 rows=25898163 loops=1) Hash Cond: (prt2_p5.b = prt_p5.a) -> Index Scan using p225_idx on prt2_p5 (cost=0.42..4090.26 rows=222789 width=8) (actual time=0.058..344.698 rows=221372 loops=1) Index Cond: (a > 8000) -> Hash (cost=4216.37..4216.37 rows=292237 width=8) (actual time=100.014..100.014 rows=292237 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 15512kB -> Seq Scan on prt_p5 (cost=0.00..4216.37 rows=292237 width=8) (actual time=0.021..41.387 rows=292237 loops=1) -> Hash Join (cost=11966.50..568150.92 rows=38427514 width=16) (actual time=458.129..12581.893 rows=38668180 loops=1) Hash Cond: (prt_p6.a = prt2_p6.b) -> Seq Scan on prt_p6 (cost=0.00..7148.22 rows=495522 width=8) (actual time=0.022..84.237 rows=495522 loops=1) -> Hash (cost=7116.44..7116.44 rows=388005 width=8) (actual time=456.437..456.437 rows=388880 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 19287kB -> Index Scan using p26_idx on prt2_p6 (cost=0.42..7116.44 rows=388005 width=8) (actual time=0.117..357.933 rows=388880 loops=1) Index Cond: (a > 8000) -> Hash Join (cost=5661.21..188902.16 rows=14376555 width=16) (actual time=74.503..4913.965 rows=14395708 loops=1) Hash Cond: (prt2_p7.b = prt_p7.a) -> Index Scan using p27_idx on prt2_p7 (cost=0.42..3134.28 rows=171019 width=8) (actual time=0.064..249.783 rows=171000 loops=1) Index Cond: (a > 8000) -> Hash (cost=3033.13..3033.13 rows=210213 width=8) (actual time=73.583..73.583 rows=210213 loops=1) Buckets: 262144 Batches: 1 Memory Usage: 10260kB -> Seq Scan on prt_p7 (cost=0.00..3033.13 rows=210213 width=8) (actual time=0.026..30.743 rows=210213 loops=1) -> Hash Join (cost=9812.96..316264.89 rows=21807961 width=16) (actual time=141.243..8080.411 rows=21873895 loops=1) Hash Cond: (prt2_p8.b = prt_p8.a) -> Index Scan using p28_idx on prt2_p8 (cost=0.42..5494.15 rows=300013 width=8) (actual time=0.067..455.100 rows=299361 loops=1) Index Cond: (a > 8000) -> Hash (cost=5257.24..5257.24 rows=364424 width=8) (actual time=140.152..140.152 rows=364424 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 18332kB -> Seq Scan on prt_p8 (cost=0.00..5257.24 rows=364424 width=8) (actual time=0.018..56.319 rows=364424 loops=1) -> Hash Join (cost=4238.67..113428.51 rows=8239032 width=16) (actual time=57.754..2798.702 rows=8269995 loops=1) Hash Cond: (prt2_p9.b = prt_p9.a) -> Index Scan using p29_idx on prt2_p9 (cost=0.42..2398.95 rows=131012 width=8) (actual time=0.059..174.564 rows=131315 loops=1) Index Cond: (a > 8000) -> Hash (cost=2270.89..2270.89 rows=157389 width=8) (actual time=56.998..56.998 rows=157389 loops=1) Buckets: 262144 Batches: 1 Memory Usage: 8197kB -> Seq Scan on prt_p9 (cost=0.00..2270.89 rows=157389 width=8) (actual time=0.021..24.027 rows=157389 loops=1) -> Hash Join (cost=3815.36..91570.17 rows=6821662 width=16) (actual time=48.525..2211.622 rows=6821467 loops=1) Hash Cond: (prt2_p10.b = prt_p10.a) -> Index Scan using p210_idx on prt2_p10 (cost=0.42..2206.96 rows=120568 width=8) (actual time=0.059..143.310 rows=120330 loops=1) Index Cond: (a > 8000) -> Hash (cost=2043.86..2043.86 rows=141686 width=8) (actual time=47.768..47.768 rows=141686 loops=1) Buckets: 262144 Batches: 1 Memory Usage: 7583kB -> Seq Scan on prt_p10 (cost=0.00..2043.86 rows=141686 width=8) (actual time=0.026..19.607 rows=141686 loops=1) -> Hash Join (cost=3476.94..76351.82 rows=5649049 width=16) (actual time=42.575..1891.480 rows=5648150 loops=1) Hash Cond: (prt2_p11.b = prt_p11.a) -> Index Scan using p211_idx on prt2_p11 (cost=0.42..2005.05 rows=109560 width=8) (actual time=0.063..139.987 rows=109297 loops=1) Index Cond: (a > 8000) -> Hash (cost=1862.90..1862.90 rows=129090 width=8) (actual time=42.093..42.093 rows=129090 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 6067kB -> Seq Scan on prt_p11 (cost=0.00..1862.90 rows=129090 width=8) (actual time=0.019..17.494 rows=129090 loops=1) -> Hash Join (cost=3144.68..64789.16 rows=4649539 width=16) (actual time=41.510..1698.937 rows=4658920 loops=1) Hash Cond: (prt2_p12.b = prt_p12.a) -> Index Scan using p212_idx on prt2_p12 (cost=0.42..1823.33 rows=99635 width=8) (actual time=0.056..142.608 rows=99686 loops=1) Index Cond: (a > 8000) -> Hash (cost=1684.67..1684.67 rows=116767 width=8) (actual time=41.070..41.070 rows=116767 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 5586kB -> Seq Scan on prt_p12 (cost=0.00..1684.67 rows=116767 width=8) (actual time=0.045..17.492 rows=116767 loops=1) -> Hash Join (cost=2834.72..53113.10 rows=3809063 width=16) (actual time=42.091..1488.251 rows=3824163 loops=1) Hash Cond: (prt2_p13.b = prt_p13.a) -> Index Scan using p213_idx on prt2_p13 (cost=0.42..1657.66 rows=90585 width=8) (actual time=0.150..139.978 rows=90710 loops=1) Index Cond: (a > 8000) -> Hash (cost=1518.58..1518.58 rows=105258 width=8) (actual time=41.577..41.577 rows=105258 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 5136kB -> Seq Scan on prt_p13 (cost=0.00..1518.58 rows=105258 width=8) (actual time=0.027..17.481 rows=105258 loops=1) -> Hash Join (cost=2551.47..43708.38 rows=3082164 width=16) (actual time=36.366..1105.889 rows=3083879 loops=1) Hash Cond: (prt2_p14.b = prt_p14.a) -> Index Scan using p214_idx on prt2_p14 (cost=0.29..1488.21 rows=81355 width=8) (actual time=0.068..104.507 rows=81339 loops=1) Index Cond: (a > 8000) -> Hash (cost=1367.19..1367.19 rows=94719 width=8) (actual time=35.898..35.898 rows=94719 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 4724kB -> Seq Scan on prt_p14 (cost=0.00..1367.19 rows=94719 width=8) (actual time=0.031..15.065 rows=94719 loops=1) -> Hash Join (cost=2269.57..35319.68 rows=2473278 width=16) (actual time=33.503..868.354 rows=2474533 loops=1) Hash Cond: (prt2_p21.b = prt_p21.a) -> Seq Scan on prt2_p21 (cost=0.00..1432.24 rows=73441 width=8) (actual time=0.036..24.487 rows=73352 loops=1) Filter: (a > 8000) Rows Removed by Filter: 11227 -> Hash (cost=1215.92..1215.92 rows=84292 width=8) (actual time=33.097..33.097 rows=84292 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 4317kB -> Seq Scan on prt_p21 (cost=0.00..1215.92 rows=84292 width=8) (actual time=0.016..13.792 rows=84292 loops=1) -> Hash Join (cost=2030.16..28371.49 rows=1967557 width=16) (actual time=27.343..800.942 rows=1973518 loops=1) Hash Cond: (prt2_p15.b = prt_p15.a) -> Index Scan using p215_idx on prt2_p15 (cost=0.29..1194.92 rows=65327 width=8) (actual time=0.059..91.958 rows=65345 loops=1) Index Cond: (a > 8000) -> Hash (cost=1087.72..1087.72 rows=75372 width=8) (actual time=26.906..26.906 rows=75372 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 3969kB -> Seq Scan on prt_p15 (cost=0.00..1087.72 rows=75372 width=8) (actual time=0.019..11.602 rows=75372 loops=1) -> Hash Join (cost=1791.43..22600.42 rows=1552736 width=16) (actual time=23.987..531.789 rows=1552364 loops=1) Hash Cond: (prt2_p22.b = prt_p22.a) -> Seq Scan on prt2_p22 (cost=0.00..1125.61 rows=58330 width=8) (actual time=0.021..18.539 rows=58244 loops=1) Filter: (a > 8000) Rows Removed by Filter: 8205 -> Hash (cost=960.08..960.08 rows=66508 width=8) (actual time=23.493..23.493 rows=66508 loops=1) Buckets: 131072 Batches: 1 Memory Usage: 3622kB -> Seq Scan on prt_p22 (cost=0.00..960.08 rows=66508 width=8) (actual time=0.018..9.874 rows=66508 loops=1) -> Hash Join (cost=1566.24..17679.57 rows=1186015 width=16) (actual time=52.907..495.921 rows=1186911 loops=1) Hash Cond: (prt2_p16.b = prt_p16.a) -> Index Scan using p216_idx on prt2_p16 (cost=0.29..933.92 rows=51070 width=8) (actual time=0.061..61.543 rows=51004 loops=1) Index Cond: (a > 8000) -> Hash (cost=839.31..839.31 rows=58131 width=8) (actual time=52.486..52.486 rows=58131 loops=1) Buckets: 65536 Batches: 1 Memory Usage: 2783kB -> Seq Scan on prt_p16 (cost=0.00..839.31 rows=58131 width=8) (actual time=0.024..10.870 rows=58131 loops=1) -> Hash Join (cost=1405.50..13539.51 rows=880320 width=16) (actual time=57.482..305.184 rows=885535 loops=1) Hash Cond: (prt_p23.a = prt2_p23.b) -> Seq Scan on prt_p23 (cost=0.00..718.57 rows=49757 width=8) (actual time=0.018..7.199 rows=49757 loops=1) -> Hash (cost=852.10..852.10 rows=44272 width=8) (actual time=47.204..47.204 rows=44320 loops=1) Buckets: 65536 Batches: 1 Memory Usage: 2244kB -> Seq Scan on prt2_p23 (cost=0.00..852.10 rows=44272 width=8) (actual time=0.047..13.050 rows=44320 loops=1) Filter: (a > 8000) Rows Removed by Filter: 6008 -> Hash Join (cost=1135.84..9774.24 rows=624675 width=16) (actual time=49.304..302.969 rows=628123 loops=1) Hash Cond: (prt2_p17.b = prt_p17.a) -> Index Scan using p217_idx on prt2_p17 (cost=0.29..677.86 rows=37061 width=8) (actual time=0.112..42.985 rows=37063 loops=1) Index Cond: (a > 8000) -> Hash (cost=608.58..608.58 rows=42158 width=8) (actual time=40.676..40.676 rows=42158 loops=1) Buckets: 65536 Batches: 1 Memory Usage: 2159kB -> Seq Scan on prt_p17 (cost=0.00..608.58 rows=42158 width=8) (actual time=0.051..8.416 rows=42158 loops=1) -> Hash Join (cost=946.92..7198.15 rows=433579 width=16) (actual time=17.315..201.412 rows=435011 loops=1) Hash Cond: (prt2_p18.b = prt_p18.a) -> Index Scan using p218_idx on prt2_p18 (cost=0.29..564.77 rows=30879 width=8) (actual time=0.107..35.763 rows=30844 loops=1) Index Cond: (a > 8000) -> Hash (cost=507.39..507.39 rows=35139 width=8) (actual time=13.687..13.687 rows=35139 loops=1) Buckets: 65536 Batches: 1 Memory Usage: 1885kB -> Seq Scan on prt_p18 (cost=0.00..507.39 rows=35139 width=8) (actual time=0.053..5.709 rows=35139 loops=1) -> Hash Join (cost=753.66..4859.50 rows=276812 width=16) (actual time=37.845..114.703 rows=278020 loops=1) Hash Cond: (prt2_p24.b = prt_p24.a) -> Seq Scan on prt2_p24 (cost=0.00..472.34 rows=24725 width=8) (actual time=0.035..6.067 rows=24731 loops=1) Filter: (a > 8000) Rows Removed by Filter: 3136 -> Hash (cost=403.85..403.85 rows=27985 width=8) (actual time=34.067..34.067 rows=27985 loops=1) Buckets: 32768 Batches: 1 Memory Usage: 1350kB -> Seq Scan on prt_p24 (cost=0.00..403.85 rows=27985 width=8) (actual time=0.024..6.661 rows=27985 loops=1) -> Hash Join (cost=573.62..3057.67 rows=161419 width=16) (actual time=13.506..70.265 rows=163200 loops=1) Hash Cond: (prt2_p19.b = prt_p19.a) -> Index Scan using p219_idx on prt2_p19 (cost=0.29..347.74 rows=18997 width=8) (actual time=2.073..16.875 rows=18995 loops=1) Index Cond: (a > 8000) -> Hash (cost=307.59..307.59 rows=21259 width=8) (actual time=7.488..7.488 rows=21259 loops=1) Buckets: 32768 Batches: 1 Memory Usage: 1087kB -> Seq Scan on prt_p19 (cost=0.00..307.59 rows=21259 width=8) (actual time=0.031..3.052 rows=21259 loops=1) -> Merge Join (cost=0.57..2413.81 rows=103419 width=16) (actual time=0.090..78.219 rows=110092 loops=1) Merge Cond: (prt2_p25.b = prt_p25.a) -> Index Scan using np235_idx on prt2_p25 (cost=0.29..433.67 rows=21185 width=8) (actual time=0.055..19.793 rows=21188 loops=1) Filter: (a > 8000) Rows Removed by Filter: 2588 -> Materialize (cost=0.29..435.59 rows=23878 width=8) (actual time=0.031..27.414 rows=110599 loops=1) -> Index Scan using p21_idx on prt_p25 (cost=0.29..375.90 rows=23878 width=8) (actual time=0.027..18.019 rows=23878 loops=1) -> Merge Join (cost=0.56..174.11 rows=4722 width=16) (actual time=0.073..7.189 rows=3681 loops=1) Merge Cond: (prt2_p20.b = prt_p20.a) -> Index Scan using np220_idx on prt2_p20 (cost=0.28..51.36 rows=2499 width=8) (actual time=0.045..2.352 rows=2492 loops=1) Filter: (a > 8000) Rows Removed by Filter: 292 -> Materialize (cost=0.28..53.02 rows=2882 width=8) (actual time=0.026..2.876 rows=4553 loops=1) -> Index Scan using p20_idx on prt_p20 (cost=0.28..45.81 rows=2882 width=8) (actual time=0.023..2.202 rows=2882 loops=1) Planning time: 11.547 ms Execution time: 165830.201 ms (182 rows)