VGlE : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #LaHU; plan #IaEQ; plan #ewLA; plan #ZqOR; plan #SdSy; plan #NX5; plan #AAo9; plan #IMEN; plan #VYE1; plan #l3H2 | explain.depesz.com
Result: VGlE : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #LaHU; plan #IaEQ; plan #ewLA; plan #ZqOR; plan #SdSy; plan #NX5; plan #AAo9; plan #IMEN; plan #VYE1; plan #l3H2
1. 0.025 716.317 ↑ 18.9 26 1
Sort (cost=12,050.22..12,051.45 rows=492 width=220) (actual time=716.315..716.317 rows=26 loops=1)
2. 0.081 716.292 ↑ 18.9 26 1
Hash Left Join (cost=10,579.45..12,028.22 rows=492 width=220) (actual time=714.172..716.292 rows=26 loops=1)
3. 0.023 715.861 ↑ 18.9 26 1
Hash Join (cost=10,533.02..11,963.95 rows=492 width=140) (actual time=713.794..715.861 rows=26 loops=1)
4. 0.070 29.931 ↑ 3.3 44 1
Hash Right Join (cost=3,383.39..4,796.81 rows=144 width=124) (actual time=27.843..29.931 rows=44 loops=1)
5. 0.001 29.658 ↓ 4.5 580 1
Nested Loop (cost=3,155.70..4,568.43 rows=128 width=28) (actual time=27.555..29.658 rows=580 loops=1)
6. 18.762 27.701 ↓ 1.1 978 1
HashAggregate (cost=3,155.41..3,164.71 rows=930 width=8) (actual time=27.543..27.701 rows=978 loops=1)
7. 8.939 8.939 ↓ 1.0 94,443 1
Seq Scan on campaigns (cost=0.00..2,683.27 rows=94,427 width=8) (actual time=0.010..8.939 rows=94,443 loops=1)
9. 0.012 0.203 ↑ 3.3 44 1
Hash (cost=225.90..225.90 rows=144 width=100) (actual time=0.203..0.203 rows=44 loops=1)
10. 0.092 0.191 ↑ 3.3 44 1
HashAggregate (cost=216.90..224.46 rows=144 width=100) (actual time=0.166..0.191 rows=44 loops=1)
11. 0.099 0.099 ↓ 1.0 157 1
Index Scan using boosts_pkey on campaigns b (cost=0.29..208.71 rows=156 width=36) (actual time=0.037..0.099 rows=157 loops=1)
12. 0.012 685.907 ↑ 26.3 26 1
Hash (cost=7,141.09..7,141.09 rows=683 width=20) (actual time=685.907..685.907 rows=26 loops=1)
13. 0.002 685.895 ↑ 26.3 26 1
Subquery Scan on imb (cost=7,127.43..7,141.09 rows=683 width=20) (actual time=685.889..685.895 rows=26 loops=1)
14. 317.657 685.893 ↑ 26.3 26 1
HashAggregate (cost=7,127.43..7,134.26 rows=683 width=20) (actual time=685.888..685.893 rows=26 loops=1)
15. 368.236 368.236 ↓ 300.1 1,383,231 1
Index Scan using widgets_date_source_id_idx on widgets (cost=0.44..7,092.86 rows=4,609 width=12) (actual time=0.019..368.236 rows=1,383,231 loops=1)
16. 0.197 0.350 ↑ 1.0 1,486 1
Hash (cost=27.86..27.86 rows=1,486 width=43) (actual time=0.350..0.350 rows=1,486 loops=1)
17. 0.153 0.153 ↑ 1.0 1,486 1
Seq Scan on campaign_names_groups names (cost=0.00..27.86 rows=1,486 width=43) (actual time=0.018..0.153 rows=1,486 loops=1)
: 716.537 ms
Sort  (cost=12050.22..12051.45 rows=492 width=220) (actual time=716.315..716.317 rows=26 loops=1)
->  Hash Left Join  (cost=10579.45..12028.22 rows=492 width=220) (actual time=714.172..716.292 rows=26 loops=1)
->  Hash Join  (cost=10533.02..11963.95 rows=492 width=140) (actual time=713.794..715.861 rows=26 loops=1)
->  Hash Right Join  (cost=3383.39..4796.81 rows=144 width=124) (actual time=27.843..29.931 rows=44 loops=1)
->  Nested Loop  (cost=3155.70..4568.43 rows=128 width=28) (actual time=27.555..29.658 rows=580 loops=1)
->  HashAggregate  (cost=3155.41..3164.71 rows=930 width=8) (actual time=27.543..27.701 rows=978 loops=1)
->  Seq Scan on campaigns  (cost=0.00..2683.27 rows=94427 width=8) (actual time=0.010..8.939 rows=94443 loops=1)
->  Hash  (cost=225.90..225.90 rows=144 width=100) (actual time=0.203..0.203 rows=44 loops=1)
->  HashAggregate  (cost=216.90..224.46 rows=144 width=100) (actual time=0.166..0.191 rows=44 loops=1)
->  Index Scan using boosts_pkey on campaigns b  (cost=0.29..208.71 rows=156 width=36) (actual time=0.037..0.099 rows=157 loops=1)
->  Hash  (cost=7141.09..7141.09 rows=683 width=20) (actual time=685.907..685.907 rows=26 loops=1)
->  Subquery Scan on imb  (cost=7127.43..7141.09 rows=683 width=20) (actual time=685.889..685.895 rows=26 loops=1)
->  HashAggregate  (cost=7127.43..7134.26 rows=683 width=20) (actual time=685.888..685.893 rows=26 loops=1)
->  Index Scan using widgets_date_source_id_idx on widgets  (cost=0.44..7092.86 rows=4609 width=12) (actual time=0.019..368.236 rows=1383231 loops=1)
->  Hash  (cost=27.86..27.86 rows=1486 width=43) (actual time=0.350..0.350 rows=1486 loops=1)
->  Seq Scan on campaign_names_groups names  (cost=0.00..27.86 rows=1486 width=43) (actual time=0.018..0.153 rows=1486 loops=1)
Planning time: 0.882 ms
Execution time: 716.537 ms
Hash 3 0.221 ms 0.0 %
Hash Left Join 1 0.081 ms 0.0 %
Hash Right Join 1 0.070 ms 0.0 %
HashAggregate 3 336.511 ms 47.0 %
Index Scan 3 370.291 ms 51.7 %
Seq Scan 2 9.092 ms 1.3 %
campaign_names_groups 1 0.153 ms 0.0 %
campaigns 3 10.994 ms 1.5 %
Index Scan 2 2.055 ms 18.7 %
Seq Scan 1 8.939 ms 81.3 %
widgets 1 368.236 ms 51.4 %
Index Scan 1 368.236 ms 100.0 %