explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Pync

Settings
# exclusive inclusive rows x rows loops node
1. 105.452 508.704 ↑ 1.0 29,712 1

WindowAgg (cost=253,015.89..2,041,214.40 rows=29,779 width=71) (actual time=175.705..508.704 rows=29,712 loops=1)

2. 46.602 195.268 ↑ 1.0 29,712 1

Sort (cost=253,015.89..253,090.34 rows=29,779 width=71) (actual time=175.637..195.268 rows=29,712 loops=1)

  • Sort Key: (COALESCE((count(*)), '0'::bigint)) DESC
  • Sort Method: external merge Disk: 2464kB
3. 69.399 148.666 ↑ 1.0 29,712 1

Nested Loop Left Join (cost=0.28..250,803.02 rows=29,779 width=71) (actual time=0.025..148.666 rows=29,712 loops=1)

4. 19.843 19.843 ↑ 1.0 29,712 1

Seq Scan on company c (cost=0.00..1,403.89 rows=29,779 width=63) (actual time=0.007..19.843 rows=29,712 loops=1)

  • Filter: (deleted_timestamp IS NULL)
  • Rows Removed by Filter: 5208
5. 29.712 59.424 ↓ 0.0 0 29,712

GroupAggregate (cost=0.28..8.36 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=29,712)

  • Group Key: pd.company_id
6. 29.712 29.712 ↓ 0.0 0 29,712

Index Only Scan using position_description__company_id__fkey on position_description pd (cost=0.28..8.33 rows=3 width=4) (actual time=0.001..0.001 rows=0 loops=29,712)

  • Index Cond: (company_id = c.id)
  • Heap Fetches: 240
7.          

SubPlan (forWindowAgg)

8. 118.848 207.984 ↑ 1.0 1 29,712

Aggregate (cost=60.00..60.02 rows=1 width=17) (actual time=0.006..0.007 rows=1 loops=29,712)

9. 89.136 89.136 ↑ 8.0 1 29,712

Index Scan using client_account_pkey on user_account (cost=0.28..59.98 rows=8 width=17) (actual time=0.002..0.003 rows=1 loops=29,712)

  • Index Cond: (id = ANY (c.company_owner_ids))
  • Filter: (deleted_timestamp IS NULL)
  • Rows Removed by Filter: 0