explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ci7I : Optimization for: plan #XpvC

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 3,517.197 ↓ 0.0 0 1

Unique (cost=209,307.63..209,307.93 rows=30 width=19) (actual time=3,517.196..3,517.197 rows=0 loops=1)

2. 0.005 3,517.196 ↓ 0.0 0 1

Sort (cost=209,307.63..209,307.70 rows=30 width=19) (actual time=3,517.196..3,517.196 rows=0 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_pay_doc_out.basedocumentmodel_ptr_id
  • Sort Method: quicksort Memory: 25kB
3. 331.634 3,517.191 ↓ 0.0 0 1

Hash Join (cost=17,883.89..209,306.89 rows=30 width=19) (actual time=3,517.191..3,517.191 rows=0 loops=1)

  • Hash Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = document_base.id)
4. 3,030.588 3,185.414 ↓ 1.6 4,535,292 1

Seq Scan on document_pay_doc_out (cost=17,640.30..198,700.26 rows=2,763,398 width=4) (actual time=508.934..3,185.414 rows=4,535,292 loops=1)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 991521
5.          

SubPlan (forSeq Scan)

6. 154.826 154.826 ↓ 1.0 991,521 1

Seq Scan on pay_doc_registry_mediator u0 (cost=0.00..15,255.64 rows=953,864 width=4) (actual time=0.005..154.826 rows=991,521 loops=1)

  • Filter: (registry_id IS NOT NULL)
7. 0.016 0.143 ↑ 1.4 107 1

Hash (cost=241.69..241.69 rows=152 width=19) (actual time=0.142..0.143 rows=107 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
8. 0.127 0.127 ↑ 1.4 107 1

Index Scan using document_base_ent_id_date_formatting_f1cc9952_idx on document_base (cost=0.56..241.69 rows=152 width=19) (actual time=0.018..0.127 rows=107 loops=1)

  • Index Cond: ((ent_id = 6677) AND (date_formatting <= '2019-12-31'::date) AND (date_formatting >= '2019-01-01'::date))
  • Filter: (state <> 4)
Planning time : 0.486 ms
Execution time : 3,522.555 ms