explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zc0E : 2nd longest query on user admin

Settings
# exclusive inclusive rows x rows loops node
1. 0.025 2,601.740 ↓ 1.5 3 1

Sort (cost=1,180,399.26..1,180,399.26 rows=2 width=338) (actual time=2,601.739..2,601.740 rows=3 loops=1)

  • Sort Key: beyond_managed_accounts.deleted_at DESC, beyond_managed_accounts.id
  • Sort Method: quicksort Memory: 26kB
2. 2.641 2,601.715 ↓ 1.5 3 1

Hash Right Join (cost=1,172,544.98..1,180,399.25 rows=2 width=338) (actual time=2,589.867..2,601.715 rows=3 loops=1)

  • Hash Cond: (ma.id = beyond_managed_accounts.id)
3. 10.796 2,599.039 ↑ 2.2 36,934 1

Merge Left Join (cost=1,172,532.54..1,179,353.28 rows=81,863 width=32) (actual time=2,580.194..2,599.039 rows=36,934 loops=1)

  • Merge Cond: (ma.id = cls.managed_account_id)
4.          

CTE channel_listings_summary

5. 13.474 2,566.798 ↓ 3.0 27,165 1

Finalize GroupAggregate (cost=1,171,378.81..1,171,745.49 rows=9,167 width=36) (actual time=2,547.559..2,566.798 rows=27,165 loops=1)

  • Group Key: beyond_channel_listings.managed_account_id
6. 0.559 2,553.324 ↓ 2.2 40,268 1

Sort (cost=1,171,378.81..1,171,424.65 rows=18,334 width=36) (actual time=2,547.550..2,553.324 rows=40,268 loops=1)

  • Sort Key: beyond_channel_listings.managed_account_id
  • Sort Method: quicksort Memory: 4092kB
7. 88.021 2,552.765 ↓ 2.2 40,268 1

Gather (cost=1,168,155.49..1,170,080.56 rows=18,334 width=36) (actual time=2,521.353..2,552.765 rows=40,268 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 34.141 2,464.744 ↓ 1.5 13,423 3

Partial HashAggregate (cost=1,167,155.49..1,167,247.16 rows=9,167 width=36) (actual time=2,461.236..2,464.744 rows=13,423 loops=3)

  • Group Key: beyond_channel_listings.managed_account_id
9. 69.507 2,430.603 ↑ 2.5 101,448 3

Hash Join (cost=633,204.41..1,164,004.14 rows=252,108 width=11) (actual time=1,803.220..2,430.603 rows=101,448 loops=3)

  • Hash Cond: (beyond_channel_listings.master_listing_id = beyond_listings.id)
10. 558.858 558.858 ↑ 2.5 101,448 3

Parallel Seq Scan on beyond_channel_listings (cost=0.00..526,053.95 rows=252,108 width=13) (actual time=0.020..558.858 rows=101,448 loops=3)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 38007
11. 74.919 1,802.238 ↑ 1.0 414,856 3

Hash (cost=626,394.96..626,394.96 rows=414,996 width=6) (actual time=1,802.238..1,802.238 rows=414,856 loops=3)

  • Buckets: 131072 Batches: 8 Memory Usage: 3049kB
12. 1,727.319 1,727.319 ↑ 1.0 414,856 3

Seq Scan on beyond_listings (cost=0.00..626,394.96 rows=414,996 width=6) (actual time=0.246..1,727.319 rows=414,856 loops=3)

13. 6.579 6.579 ↑ 2.2 36,934 1

Index Only Scan using beyond_managedaccount_pkey on beyond_managed_accounts ma (cost=0.42..5,660.36 rows=81,863 width=4) (actual time=0.007..6.579 rows=36,934 loops=1)

  • Heap Fetches: 9
14. 6.202 2,581.664 ↓ 3.0 27,165 1

Sort (cost=786.63..809.55 rows=9,167 width=36) (actual time=2,580.180..2,581.664 rows=27,165 loops=1)

  • Sort Key: cls.managed_account_id
  • Sort Method: quicksort Memory: 2891kB
15. 2,575.462 2,575.462 ↓ 3.0 27,165 1

CTE Scan on channel_listings_summary cls (cost=0.00..183.34 rows=9,167 width=36) (actual time=2,547.563..2,575.462 rows=27,165 loops=1)

16. 0.006 0.035 ↓ 1.5 3 1

Hash (cost=12.42..12.42 rows=2 width=318) (actual time=0.035..0.035 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.029 0.029 ↓ 1.5 3 1

Index Scan using beyond_managedaccount_e8701ad4 on beyond_managed_accounts (cost=0.42..12.42 rows=2 width=318) (actual time=0.019..0.029 rows=3 loops=1)

  • Index Cond: (user_id = 17355)
Planning time : 0.729 ms
Execution time : 2,620.664 ms