explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WzFg

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 338.921 ↓ 3.0 3 1

GroupAggregate (cost=94,275.86..94,275.94 rows=1 width=40) (actual time=338.902..338.921 rows=3 loops=1)

  • Group Key: vet_document.owner_id
2.          

CTE lp

3. 0.028 0.028 ↑ 1.0 3 1

Index Scan using legal_person_pkey on legal_person (cost=0.29..24.73 rows=3 width=16) (actual time=0.020..0.028 rows=3 loops=1)

  • Index Cond: (id = ANY ('{3313,3274,3265}'::bigint[]))
4. 0.020 338.882 ↓ 41.0 41 1

Sort (cost=94,251.13..94,251.14 rows=1 width=33) (actual time=338.879..338.882 rows=41 loops=1)

  • Sort Key: vet_document.owner_id
  • Sort Method: quicksort Memory: 28kB
5. 0.000 338.862 ↓ 41.0 41 1

Hash Join (cost=1,000.10..94,251.12 rows=1 width=33) (actual time=0.296..338.862 rows=41 loops=1)

  • Hash Cond: (vet_document.owner_id = lp.id)
6. 45.788 340.404 ↑ 3.4 41 1

Gather (cost=1,000.00..94,250.49 rows=139 width=25) (actual time=0.257..340.404 rows=41 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 294.616 294.616 ↑ 4.1 14 3

Parallel Seq Scan on vet_document (cost=0.00..93,236.59 rows=58 width=25) (actual time=181.782..294.616 rows=14 loops=3)

  • Filter: (create_date > (CURRENT_TIMESTAMP - '7 days'::interval))
  • Rows Removed by Filter: 465903
8. 0.002 0.034 ↑ 1.0 3 1

Hash (cost=0.06..0.06 rows=3 width=16) (actual time=0.034..0.034 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.032 0.032 ↑ 1.0 3 1

CTE Scan on lp (cost=0.00..0.06 rows=3 width=16) (actual time=0.022..0.032 rows=3 loops=1)