explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DLJd

Settings
# exclusive inclusive rows x rows loops node
1. 0.616 10.186 ↑ 1.0 1 1

Aggregate (cost=2,563.20..2,563.21 rows=1 width=16) (actual time=10.186..10.186 rows=1 loops=1)

2.          

CTE lp

3. 0.023 0.082 ↓ 1.5 6 1

Nested Loop (cost=4.89..28.81 rows=4 width=16) (actual time=0.023..0.082 rows=6 loops=1)

4. 0.006 0.023 ↓ 1.5 6 1

Nested Loop (cost=4.61..26.91 rows=4 width=8) (actual time=0.017..0.023 rows=6 loops=1)

5. 0.007 0.007 ↑ 1.0 1 1

Index Scan using idx_access_profile_user_id on access_profile (cost=0.29..8.30 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (user_id = 13)
6. 0.005 0.010 ↓ 1.5 6 1

Bitmap Heap Scan on access_legal_person alp (cost=4.32..18.57 rows=4 width=12) (actual time=0.008..0.010 rows=6 loops=1)

  • Recheck Cond: (access_profile_id = access_profile.id)
  • Heap Blocks: exact=1
7. 0.005 0.005 ↓ 1.5 6 1

Bitmap Index Scan on idx_access_legal_person_prof_id_lp_id (cost=0.00..4.32 rows=4 width=0) (actual time=0.005..0.005 rows=6 loops=1)

  • Index Cond: (access_profile_id = access_profile.id)
8. 0.036 0.036 ↑ 1.0 1 6

Index Scan using legal_person_pkey on legal_person (cost=0.29..0.47 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=6)

  • Index Cond: (id = alp.legal_person_id)
9. 1.214 9.570 ↓ 8.7 5,524 1

Hash Join (cost=7.08..2,529.62 rows=635 width=524) (actual time=0.272..9.570 rows=5,524 loops=1)

  • Hash Cond: (invoice.egais_status_id = es.id)
10. 2.606 8.343 ↓ 8.7 5,524 1

Nested Loop (cost=5.66..2,526.44 rows=635 width=16) (actual time=0.253..8.343 rows=5,524 loops=1)

11. 0.103 0.103 ↓ 1.5 6 1

CTE Scan on lp (cost=0.00..0.08 rows=4 width=8) (actual time=0.025..0.103 rows=6 loops=1)

12. 5.058 5.634 ↓ 5.8 921 6

Bitmap Heap Scan on invoice (cost=5.66..630.00 rows=159 width=24) (actual time=0.199..0.939 rows=921 loops=6)

  • Recheck Cond: ((buyer_legal_person_id = lp.id) AND ((exchange_channel)::text = 'EGAIS'::text))
  • Heap Blocks: exact=4993
13. 0.576 0.576 ↓ 5.8 921 6

Bitmap Index Scan on idx_invoice_buyer_legal_person_id_egais_id (cost=0.00..5.62 rows=159 width=0) (actual time=0.096..0.096 rows=921 loops=6)

  • Index Cond: (buyer_legal_person_id = lp.id)
14. 0.005 0.013 ↑ 1.0 19 1

Hash (cost=1.19..1.19 rows=19 width=524) (actual time=0.013..0.013 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
15. 0.008 0.008 ↑ 1.0 19 1

Seq Scan on egais_status es (cost=0.00..1.19 rows=19 width=524) (actual time=0.006..0.008 rows=19 loops=1)