explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wD9I

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 2,112.698 ↑ 1.0 200 1

Limit (cost=101,299.15..101,299.65 rows=200 width=602) (actual time=2,112.669..2,112.698 rows=200 loops=1)

2. 881.270 2,112.676 ↑ 8,363.0 200 1

Sort (cost=101,299.15..105,480.65 rows=1,672,600 width=602) (actual time=2,112.667..2,112.676 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: 134kB
3. 303.255 1,231.406 ↑ 1.0 1,672,600 1

Nested Loop (cost=6.01..29,010.58 rows=1,672,600 width=602) (actual time=24.625..1,231.406 rows=1,672,600 loops=1)

4. 0.396 825.951 ↑ 1.0 200 1

Nested Loop Left Join (cost=6.01..6,675.54 rows=200 width=504) (actual time=24.600..825.951 rows=200 loops=1)

5. 0.477 824.955 ↑ 1.0 200 1

Nested Loop Left Join (cost=5.58..6,267.77 rows=200 width=504) (actual time=24.591..824.955 rows=200 loops=1)

6. 0.506 822.878 ↑ 1.0 200 1

Nested Loop Left Join (cost=5.16..5,744.27 rows=200 width=500) (actual time=24.561..822.878 rows=200 loops=1)

7. 0.525 821.572 ↑ 1.0 200 1

Nested Loop Left Join (cost=4.87..5,370.53 rows=200 width=442) (actual time=24.546..821.572 rows=200 loops=1)

8. 0.536 818.847 ↑ 1.0 200 1

Nested Loop Left Join (cost=4.44..4,845.93 rows=200 width=438) (actual time=24.512..818.847 rows=200 loops=1)

9. 0.507 818.311 ↑ 1.0 200 1

Nested Loop Left Join (cost=4.16..4,469.36 rows=200 width=405) (actual time=24.502..818.311 rows=200 loops=1)

10. 0.460 816.604 ↑ 1.0 200 1

Nested Loop Left Join (cost=3.73..3,940.46 rows=200 width=391) (actual time=24.489..816.604 rows=200 loops=1)

11. 0.501 814.944 ↑ 1.0 200 1

Nested Loop Left Join (cost=3.29..3,411.56 rows=200 width=381) (actual time=24.481..814.944 rows=200 loops=1)

12. 0.568 814.443 ↑ 1.0 200 1

Nested Loop Left Join (cost=2.88..3,005.17 rows=200 width=337) (actual time=24.473..814.443 rows=200 loops=1)

13. 0.556 801.675 ↑ 1.0 200 1

Nested Loop Left Join (cost=2.45..2,596.57 rows=200 width=323) (actual time=24.423..801.675 rows=200 loops=1)

14. 0.601 799.319 ↑ 1.0 200 1

Nested Loop Left Join (cost=2.02..2,188.20 rows=200 width=252) (actual time=24.383..799.319 rows=200 loops=1)

15. 0.598 797.718 ↑ 1.0 200 1

Nested Loop Left Join (cost=1.73..1,808.90 rows=200 width=254) (actual time=24.350..797.718 rows=200 loops=1)

16. 0.705 795.520 ↑ 1.0 200 1

Nested Loop (cost=1.30..1,286.50 rows=200 width=237) (actual time=24.295..795.520 rows=200 loops=1)

17. 14.615 781.015 ↑ 1.0 200 1

Nested Loop (cost=0.87..877.42 rows=200 width=151) (actual time=23.475..781.015 rows=200 loops=1)

  • -> Index Scan using document_pa_basedoc_f82edc_idx on document_pay_doc_out (cost=0.43..346.42 rows=200 width=88) (actual time=0.111..13.329 rows=200 loops=1 (...)
  • Index Cond: (basedocumentmodel_ptr_id = ANY ('{24799298,44794007,24799322,44795807,24799342,24799435,24799448,24799463,24799483,24799504,24799526,247995 (...)
18. 766.400 766.400 ↑ 1.0 1 200

Index Scan using document_base_pkey on document_base (cost=0.44..2.66 rows=1 width=67) (actual time=3.832..3.832 rows=1 loops=200)

  • Index Cond: (id = document_pay_doc_out.basedocumentmodel_ptr_id)
19. 13.800 13.800 ↑ 1.0 1 200

Index Scan using document_types_pkey on document_types (cost=0.43..2.05 rows=1 width=90) (actual time=0.069..0.069 rows=1 loops=200)

  • Index Cond: (id = document_base.type_id)
20. 1.600 1.600 ↑ 1.0 1 200

Index Scan using kbk_pkey on kbk (cost=0.43..2.61 rows=1 width=25) (actual time=0.008..0.008 rows=1 loops=200)

  • Index Cond: (document_pay_doc_out.main_kbk_id = id)
21. 1.000 1.000 ↑ 1.0 1 200

Index Scan using kbk_activity_type_pkey on kbk_activity_type (cost=0.29..1.90 rows=1 width=6) (actual time=0.005..0.005 rows=1 loops=200)

  • Index Cond: (document_base.kvd_id = id)
22. 1.800 1.800 ↑ 1.0 1 200

Index Scan using contragent_supplier_pkey on contragent_supplier (cost=0.43..2.04 rows=1 width=75) (actual time=0.009..0.009 rows=1 loops=200)

  • Index Cond: (document_base.supplier_id = id)
23. 12.200 12.200 ↑ 1.0 1 200

Index Scan using contragent_corporation_pkey on contragent_corporation (cost=0.43..2.04 rows=1 width=22) (actual time=0.061..0.061 rows=1 loops=200)

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

Index Scan using contragent_mol_pkey on contragent_mol (cost=0.42..2.03 rows=1 width=52) (actual time=0.000..0.000 rows=0 loops=200)

  • Index Cond: (document_base.mol_id = id)
25. 1.200 1.200 ↑ 1.0 1 200

Index Scan using bank_props_pkey on bank_props (cost=0.43..2.64 rows=1 width=18) (actual time=0.006..0.006 rows=1 loops=200)

  • Index Cond: (document_pay_doc_out.acc_donor_id = id)
26. 1.200 1.200 ↑ 1.0 1 200

Index Scan using bank_props_pkey on bank_props t10 (cost=0.43..2.64 rows=1 width=18) (actual time=0.006..0.006 rows=1 loops=200)

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

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=200)

  • Index Cond: (document_base.department_id = id)
28. 2.200 2.200 ↑ 1.0 1 200

Index Scan using ack_doc_budget_document_id_key on ack_doc_budget (cost=0.43..2.62 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=200)

  • Index Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = doc_id)
29. 0.800 0.800 ↑ 1.0 1 200

Index Scan using ack_budget_pkey on ack_budget (cost=0.29..1.87 rows=1 width=66) (actual time=0.004..0.004 rows=1 loops=200)

  • Index Cond: (ack_doc_budget.budget_id = id)
30. 1.600 1.600 ↓ 0.0 0 200

Index Scan using pay_doc_registry_mediator_new_document_id_key on pay_doc_registry_mediator (cost=0.43..2.62 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=200)

  • Index Cond: (document_pay_doc_out.basedocumentmodel_ptr_id = document_id)
31. 0.600 0.600 ↓ 0.0 0 200

Index Scan using pay_doc_registry_pkey on pay_doc_registry (cost=0.42..2.04 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=200)

  • Index Cond: (pay_doc_registry_mediator.registry_id = id)
32. 89.358 102.200 ↑ 1.0 8,363 200

Materialize (cost=0.00..1,448.45 rows=8,363 width=98) (actual time=0.000..0.511 rows=8,363 loops=200)

33. 12.842 12.842 ↑ 1.0 8,363 1

Seq Scan on enterprise (cost=0.00..1,406.63 rows=8,363 width=98) (actual time=0.014..12.842 rows=8,363 loops=1)

Planning time : 25.456 ms
Execution time : 2,113.314 ms