explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PmsX

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 308,269.736 ↑ 2.9 10 1

Unique (cost=208,777.04..208,777.33 rows=29 width=19) (actual time=308,269.730..308,269.736 rows=10 loops=1)

2. 0.028 308,269.731 ↑ 2.9 10 1

Sort (cost=208,777.04..208,777.12 rows=29 width=19) (actual time=308,269.729..308,269.731 rows=10 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_pay_doc_out.basedocumentmodel_ptr_id
  • Sort Method: quicksort Memory: 25kB
3. 1,571.265 308,269.703 ↑ 2.9 10 1

Merge Join (cost=17,861.03..208,776.34 rows=29 width=19) (actual time=278,351.140..308,269.703 rows=10 loops=1)

  • Merge Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = document_base.id)
4. 302,930.582 306,630.539 ↓ 1.6 4,532,094 1

Index Only Scan using document_pay_doc_out_pkey on document_pay_doc_out (cost=17,640.73..202,346.80 rows=2,759,650 width=4) (actual time=7,617.904..306,630.539 rows=4,532,094 loops=1)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 990907
  • Heap Fetches: 2755775
5.          

SubPlan (forIndex Only Scan)

6. 3,699.957 3,699.957 ↓ 1.0 991,164 1

Seq Scan on pay_doc_registry_mediator u0 (cost=0.00..15,255.64 rows=953,864 width=4) (actual time=0.014..3,699.957 rows=991,164 loops=1)

  • Filter: (registry_id IS NOT NULL)
7. 0.780 67.899 ↓ 4.1 562 1

Sort (cost=220.28..220.62 rows=136 width=19) (actual time=67.399..67.899 rows=562 loops=1)

  • Sort Key: document_base.id
  • Sort Method: quicksort Memory: 55kB
8. 67.119 67.119 ↓ 4.1 562 1

Index Scan using document_base_ent_id_date_formatting_f1cc9952_idx on document_base (cost=0.56..215.46 rows=136 width=19) (actual time=0.049..67.119 rows=562 loops=1)

  • Index Cond: ((ent_id = 4708) AND (date_formatting <= '2019-12-31'::date) AND (date_formatting >= '2019-01-01'::date))
  • Filter: (state <> 4)