explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XpvC

Settings

Optimization(s) for this plan:

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

Unique (cost=209,309.01..209,309.31 rows=30 width=19) (actual time=3,394.261..3,394.261 rows=0 loops=1)

2. 0.005 3,394.260 ↓ 0.0 0 1

Sort (cost=209,309.01..209,309.09 rows=30 width=19) (actual time=3,394.260..3,394.260 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. 316.662 3,394.255 ↓ 0.0 0 1

Hash Join (cost=17,885.27..209,308.28 rows=30 width=19) (actual time=3,394.255..3,394.255 rows=0 loops=1)

  • Hash Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = document_base.id)
4. 2,935.335 3,077.446 ↓ 1.6 4,535,290 1

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

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

SubPlan (forSeq Scan)

6. 142.111 142.111 ↓ 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.010..142.111 rows=991,521 loops=1)

  • Filter: (registry_id IS NOT NULL)
7. 0.012 0.147 ↑ 1.4 107 1

Hash (cost=243.07..243.07 rows=152 width=19) (actual time=0.147..0.147 rows=107 loops=1)

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

Index Scan using document_base_ent_id_date_formatting_f1cc9952_idx on document_base (cost=0.56..243.07 rows=152 width=19) (actual time=0.020..0.135 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)