explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O5Y2

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 0.188 ↓ 3.0 3 1

GroupAggregate (cost=50.19..50.26 rows=1 width=40) (actual time=0.171..0.188 rows=3 loops=1)

  • Group Key: vet_document.owner_id
2.          

CTE lp

3. 0.019 0.019 ↑ 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.012..0.019 rows=3 loops=1)

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

Sort (cost=25.46..25.46 rows=1 width=33) (actual time=0.154..0.156 rows=41 loops=1)

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

Nested Loop (cost=0.43..25.45 rows=1 width=33) (actual time=0.080..0.142 rows=41 loops=1)

6. 0.023 0.023 ↑ 1.0 3 1

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

7. 0.099 0.099 ↓ 14.0 14 3

Index Scan using aaaaa on vet_document (cost=0.43..8.45 rows=1 width=25) (actual time=0.028..0.033 rows=14 loops=3)

  • Index Cond: ((owner_id = lp.id) AND (create_date > (CURRENT_TIMESTAMP - '7 days'::interval)))