explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dqPk

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 158,251.074 ↓ 200.0 200 1

Limit (cost=5,288.70..5,288.70 rows=1 width=602) (actual time=158,251.030..158,251.074 rows=200 loops=1)

2. 79.126 158,251.052 ↓ 200.0 200 1

Sort (cost=5,288.70..5,288.70 rows=1 width=602) (actual time=158,251.028..158,251.052 rows=200 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_pay_doc_out.basedocumentmodel_ptr_id
  • Sort Method: top-N heapsort Memory: 242kB
3. 35.749 158,171.926 ↓ 10,967.0 10,967 1

Nested Loop (cost=6.29..5,288.69 rows=1 width=602) (actual time=333.189..158,171.926 rows=10,967 loops=1)

4. 39.598 158,048.441 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=6.01..5,286.17 rows=1 width=504) (actual time=333.145..158,048.441 rows=10,967 loops=1)

5. 41.521 156,243.156 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=5.58..5,284.13 rows=1 width=504) (actual time=292.658..156,243.156 rows=10,967 loops=1)

6. 47.718 154,545.618 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=5.16..5,282.09 rows=1 width=500) (actual time=260.274..154,545.618 rows=10,967 loops=1)

7. 35.277 154,399.197 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=4.87..5,280.22 rows=1 width=442) (actual time=251.836..154,399.197 rows=10,967 loops=1)

8. 42.475 148,935.255 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=4.44..5,278.18 rows=1 width=438) (actual time=219.661..148,935.255 rows=10,967 loops=1)

9. 38.054 148,892.780 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=4.16..5,276.30 rows=1 width=405) (actual time=219.635..148,892.780 rows=10,967 loops=1)

10. 34.067 143,820.873 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=3.73..5,274.24 rows=1 width=391) (actual time=194.779..143,820.873 rows=10,967 loops=1)

11. 41.940 143,545.532 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=3.29..5,272.19 rows=1 width=381) (actual time=177.301..143,545.532 rows=10,967 loops=1)

12. 52.086 143,503.592 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=2.88..5,270.15 rows=1 width=337) (actual time=177.279..143,503.592 rows=10,967 loops=1)

13. 48.836 142,343.839 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=2.45..5,268.11 rows=1 width=323) (actual time=141.467..142,343.839 rows=10,967 loops=1)

14. 44.732 140,529.316 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=2.02..5,266.00 rows=1 width=252) (actual time=124.591..140,529.316 rows=10,967 loops=1)

15. 90.936 140,331.046 ↓ 10,967.0 10,967 1

Nested Loop Left Join (cost=1.73..5,264.10 rows=1 width=254) (actual time=113.308..140,331.046 rows=10,967 loops=1)

16. 104.252 139,779.496 ↓ 10,967.0 10,967 1

Nested Loop (cost=1.30..5,262.06 rows=1 width=237) (actual time=87.953..139,779.496 rows=10,967 loops=1)

17. 150.150 72,568.171 ↓ 10,967.0 10,967 1

Nested Loop (cost=0.87..5,259.75 rows=1 width=153) (actual time=38.812..72,568.171 rows=10,967 loops=1)

  • -> Index Scan using document_types_ent_id_7f9fb2f26c3ba828 on document_types (cost=0.43..15.55 rows=13 width=90) (actual time=10.072..126.214 rows=13 loops= (...)
  • Index Cond: ((ent_id = 3,921) AND ((document_code)::text = 'pay_docs_out_document'::text))
18. 72,418.021 72,418.021 ↓ 844.0 844 13

Index Scan using document_ba_type_id_043f68_idx on document_base (cost=0.44..403.39 rows=1 width=67) (actual time=22.995..5,570.617 rows=844 loops=13)

  • Index Cond: ((type_id = document_types.id) AND (date_formatting <= '2020-12-31'::date) AND (date_formatting >= '2019-01-01'::date))
  • Filter: ((state <> 4) AND (ent_id = 3,921))
19. 67,107.073 67,107.073 ↑ 1.0 1 10,967

Index Scan using document_pa_basedoc_f82edc_idx on document_pay_doc_out (cost=0.43..2.31 rows=1 width=88) (actual time=6.119..6.119 rows=1 loops=10,967)

  • Index Cond: (basedocumentmodel_ptr_id = document_base.id)
20. 460.614 460.614 ↑ 1.0 1 10,967

Index Scan using kbk_pkey on kbk (cost=0.43..2.04 rows=1 width=25) (actual time=0.042..0.042 rows=1 loops=10,967)

  • Index Cond: (document_pay_doc_out.main_kbk_id = id)
21. 153.538 153.538 ↑ 1.0 1 10,967

Index Scan using kbk_activity_type_pkey on kbk_activity_type (cost=0.29..1.90 rows=1 width=6) (actual time=0.014..0.014 rows=1 loops=10,967)

  • Index Cond: (document_base.kvd_id = id)
22. 1,765.687 1,765.687 ↑ 1.0 1 10,967

Index Scan using contragent_supplier_pkey on contragent_supplier (cost=0.43..2.11 rows=1 width=75) (actual time=0.161..0.161 rows=1 loops=10,967)

  • Index Cond: (document_base.supplier_id = id)
23. 1,107.667 1,107.667 ↑ 1.0 1 10,967

Index Scan using contragent_corporation_pkey on contragent_corporation (cost=0.43..2.04 rows=1 width=22) (actual time=0.101..0.101 rows=1 loops=10,967)

  • Index Cond: (contragent_supplier.corporation_id = id)
24. 0.000 0.000 ↓ 0.0 0 10,967

Index Scan using contragent_mol_pkey on contragent_mol (cost=0.42..2.04 rows=1 width=52) (actual time=0.000..0.000 rows=0 loops=10,967)

  • Index Cond: (document_base.mol_id = id)
25. 241.274 241.274 ↑ 1.0 1 10,967

Index Scan using bank_props_pkey on bank_props (cost=0.43..2.05 rows=1 width=18) (actual time=0.022..0.022 rows=1 loops=10,967)

  • Index Cond: (document_pay_doc_out.acc_donor_id = id)
26. 5,033.853 5,033.853 ↑ 1.0 1 10,967

Index Scan using bank_props_pkey on bank_props t10 (cost=0.43..2.05 rows=1 width=18) (actual time=0.459..0.459 rows=1 loops=10,967)

  • Index Cond: (document_pay_doc_out.acc_acceptor_id = id)
27. 0.000 0.000 ↓ 0.0 0 10,967

Index Scan using dicts_department_pkey on dicts_department (cost=0.28..1.88 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=10,967)

  • Index Cond: (document_base.department_id = id)
28. 5,428.665 5,428.665 ↑ 1.0 1 10,967

Index Scan using ack_doc_budget_document_id_key on ack_doc_budget (cost=0.43..2.04 rows=1 width=8) (actual time=0.495..0.495 rows=1 loops=10,967)

  • Index Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = doc_id)
29. 98.703 98.703 ↑ 1.0 1 10,967

Index Scan using ack_budget_pkey on ack_budget (cost=0.29..1.87 rows=1 width=66) (actual time=0.009..0.009 rows=1 loops=10,967)

  • Index Cond: (ack_doc_budget.budget_id = id)
30. 1,656.017 1,656.017 ↑ 1.0 1 10,967

Index Scan using pay_doc_registry_mediator_new_document_id_key on pay_doc_registry_mediator (cost=0.43..2.04 rows=1 width=8) (actual time=0.151..0.151 rows=1 loops=10,967)

  • Index Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = document_id)
31. 1,765.687 1,765.687 ↑ 1.0 1 10,967

Index Scan using pay_doc_registry_pkey on pay_doc_registry (cost=0.42..2.04 rows=1 width=8) (actual time=0.161..0.161 rows=1 loops=10,967)

  • Index Cond: (pay_doc_registry_mediator.registry_id = id)
32. 87.736 87.736 ↑ 1.0 1 10,967

Index Scan using enterprise_pkey on enterprise (cost=0.29..2.50 rows=1 width=102) (actual time=0.007..0.008 rows=1 loops=10,967)

  • Index Cond: (id = 3,921)
Planning time : 219.007 ms
Execution time : 158,251.615 ms