explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ARgp

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=687,589.25..687,589.26 rows=1 width=764) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=687,589.25..687,589.26 rows=1 width=764) (actual rows= loops=)

  • Sort Key: adset.created_at DESC, adset.adset_id
3. 0.000 0.000 ↓ 0.0

WindowAgg (cost=685,314.79..687,589.24 rows=1 width=764) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=685,314.79..687,589.21 rows=1 width=820) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=685,314.64..687,581.03 rows=1 width=824) (actual rows= loops=)

  • Join Filter: (adset.adset_id = adseterror.adset_id)
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=677,546.37..679,809.97 rows=1 width=816) (actual rows= loops=)

  • Merge Cond: (adset.adset_id = adset_creative_stat.adset_id)
7. 0.000 0.000 ↓ 0.0

Sort (cost=26.36..26.36 rows=1 width=720) (actual rows= loops=)

  • Sort Key: adset.adset_id
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..26.35 rows=1 width=720) (actual rows= loops=)

  • Join Filter: (adset.advertiser_id = advertiser.advertiser_id)
9. 0.000 0.000 ↓ 0.0

Index Scan using ix_adset_campaign_id on adset (cost=0.29..10.75 rows=3 width=684) (actual rows= loops=)

  • Index Cond: (campaign_id = 4586)
10. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..15.51 rows=2 width=40) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on advertiser (cost=0.00..15.50 rows=2 width=40) (actual rows= loops=)

  • Filter: (agency_id = 13)
12. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=677,520.01..679,688.75 rows=7,587 width=100) (actual rows= loops=)

  • Group Key: adset_creative_stat.adset_id
13. 0.000 0.000 ↓ 0.0

Gather Merge (cost=677,520.01..679,290.44 rows=15,174 width=100) (actual rows= loops=)

  • Workers Planned: 2
14. 0.000 0.000 ↓ 0.0

Sort (cost=676,519.99..676,538.96 rows=7,587 width=100) (actual rows= loops=)

  • Sort Key: adset_creative_stat.adset_id
15. 0.000 0.000 ↓ 0.0

Partial HashAggregate (cost=675,898.26..676,031.03 rows=7,587 width=100) (actual rows= loops=)

  • Group Key: adset_creative_stat.adset_id
16. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on adset_creative_stat (cost=0.00..671,200.95 rows=469,731 width=28) (actual rows= loops=)

  • Filter: ((hour >= 436246) AND (hour <= 436990))
17. 0.000 0.000 ↓ 0.0

HashAggregate (cost=7,768.27..7,769.13 rows=86 width=12) (actual rows= loops=)

  • Group Key: adseterror.adset_id
18. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,181.11..7,560.95 rows=41,464 width=8) (actual rows= loops=)

  • Hash Cond: (adseterror.adset_id = adset_1.adset_id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on adseterror (cost=0.00..6,270.96 rows=41,464 width=8) (actual rows= loops=)

  • Filter: (("time" >= '2019-10-07 22:00:00'::timestamp without time zone) AND ("time" <= '2019-11-07 22:59:59'::timestamp without time zone))
20. 0.000 0.000 ↓ 0.0

Hash (cost=992.76..992.76 rows=15,068 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Only Scan using adset_pkey on adset adset_1 (cost=0.29..992.76 rows=15,068 width=4) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Only Scan using agency_pkey on agency (cost=0.15..8.17 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (agency_id = 13)