explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4s8iJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 564.052 ↑ 8.3 24 1

Limit (cost=129,018.41..129,105.41 rows=200 width=1,772) (actual time=563.975..564.052 rows=24 loops=1)

  • Buffers: shared hit=19732
2. 0.069 564.048 ↑ 30.5 24 1

Unique (cost=129,018.41..129,337.27 rows=733 width=1,772) (actual time=563.973..564.048 rows=24 loops=1)

  • Buffers: shared hit=19732
3. 0.207 563.979 ↑ 30.5 24 1

Sort (cost=129,018.41..129,020.24 rows=733 width=1,772) (actual time=563.972..563.979 rows=24 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_base.id, document_base.version, document_base.type_id, document_base.ent_id, document_base.department_id, document_base.mol_id, document_base.supplier_id, document_base.contragent_category, document_base.last_modified, document_base.last_editor_id, document_base.old_doc_id, document_base.date_formatting, document_base.date_posting, document_base.document_storno_id, document_base.currency_id, document_base.currency_sum, document_base.total, document_base.kbk_id, document_base.kvd_id, document_base.kvd_analytic_id, document_base.warehouse_id, document_base.note, document_base.batch_processing_note, document_base.is_doc_base, document_base.created, document_invoice.invoice_date, document_invoice.invoice_nds_id, document_invoice.invoice_number, document_invoice.invoice_generate, document_invoice.country_id, document_invoice.bill_of_entry, document_invoice.invoice_shipper_id, document_invoice.invoice_consignee_id, document_invoice.service, document_invoice.invoice_code_kind_operation, document_invoice.contract_id, document_types.created, document_types.modified, document_types.external_id, document_types.ent_id, document_types.document_code, document_types.document_name, document_types.name, dicts_department.id, dicts_department.version, dicts_department.state, dicts_department.begin, dicts_department."end", dicts_department.created, dicts_department.modified, dicts_department.external_id, dicts_department.ent_id, dicts_department.direct_id, dicts_department.code, dicts_department.name, dicts_department.chief_id, contragent_mol.id, contragent_mol.version, contragent_mol.state, contragent_mol.begin, contragent_mol."end", contragent_mol.created, contragent_mol.modified, contragent_mol.external_id, contragent_mol.ent_id, contragent_mol.direct_id, contragent_mol.name, contragent_mol.person_id, contragent_mol.position_id, contragent_mol.tabel_num, contragent_mol.warehouse_id, contragent_supplier.id, contragent_supplier.version, contragent_supplier.state, contragent_supplier.begin, contragent_supplier."end", contragent_supplier.created, contragent_supplier.modified, contragent_supplier.external_id, contragent_supplier.ent_id, contragent_supplier.direct_id, contragent_supplier.name, contragent_supplier.group_id, contragent_supplier.supplier_type, contragent_supplier.person_id, contragent_supplier.corporation_id, contragent_supplier.uuid, contragent_supplier.country_id, contragent_corporation.id, contragent_corporation.short_name, contragent_corporation.full_name, contragent_corporation.inn, contragent_corporation.kpp, contragent_corporation.filial, contragent_corporation.phone, contragent_corporation.email, contragent_corporation.ent_type, contragent_corporation.okved, contragent_corporation.ogrn, contragent_corporation.okpo, contragent_corporation.okato, contragent_corporation.oktmo, contragent_corporation.ur_address_id, contragent_corporation.fact_address_id, contragent_corporation.mail_address_id, kbk.id, kbk.version, kbk.state, kbk.begin, kbk."end", kbk.created, kbk.modified, kbk.ent_id, kbk.code, kbk.full_code, kbk.code_without_dots, kbk.name, kbk.fullname, kbk.kbk_type, kbk.grbs_id, kbk.fkr_section_id, kbk.budget_target_id, kbk.outgo_type_id, kbk.income_code_id, kbk.funding_source_id, kbk.oktmo_id, kbk.analytic_group_id, kbk.acc_standalone, kbk.acc_budget, kbk.acc_official, kbk.external_id, kbk.direct_id, kbk_activity_type.id, kbk_activity_type.version, kbk_activity_type.state, kbk_activity_type.begin, kbk_activity_type."end", kbk_activity_type.created, kbk_activity_type.modified, kbk_activity_type.external_id, kbk_activity_type.ent_id, kbk_activity_type.direct_id, kbk_activity_type.code, kbk_activity_type.name, kbk_activity_type.analytic_id, kbk_activity_type.bank_props_id, unidictrec.id, unidictrec.version, unidictrec.state, unidictrec.begin, unidictrec."end", unidictrec.created, unidictrec.modified, unidictrec.external_id, unidictrec.unidict_id, unidictrec.code, unidictrec.name, contract.id, contract.created, contract.modified, contract.external_id, contract.ent_id, contract.type, contract.department_id, doc_external_relation.id, doc_external_relation.eid, doc_external_relation.service, doc_external_relation.service_name, doc_external_relation.real_type_id, external_relation_with_document.externalrelation_ptr_id, external_relation_with_document.document_id
  • Sort Method: quicksort Memory: 52kB
  • Buffers: shared hit=19732
4. 0.037 563.772 ↑ 30.5 24 1

Nested Loop (cost=81,908.49..128,983.53 rows=733 width=1,772) (actual time=428.266..563.772 rows=24 loops=1)

  • Buffers: shared hit=19732
5. 0.032 563.735 ↑ 30.5 24 1

Nested Loop (cost=81,908.34..128,550.38 rows=733 width=1,506) (actual time=428.262..563.735 rows=24 loops=1)

  • Buffers: shared hit=19732
6. 0.039 563.679 ↑ 30.5 24 1

Nested Loop (cost=81,908.18..128,121.01 rows=733 width=1,498) (actual time=428.253..563.679 rows=24 loops=1)

  • Buffers: shared hit=19708
7. 0.037 563.640 ↑ 30.5 24 1

Nested Loop (cost=81,907.76..127,030.59 rows=733 width=1,460) (actual time=428.249..563.64 rows=24 loops=1)

  • Buffers: shared hit=19708
8. 0.036 563.603 ↑ 30.5 24 1

Nested Loop (cost=81,907.33..122,173.82 rows=733 width=1,309) (actual time=428.244..563.603 rows=24 loops=1)

  • Buffers: shared hit=19708
9. 0.049 563.471 ↑ 30.5 24 1

Nested Loop (cost=81,907.04..120,961.38 rows=733 width=1,186) (actual time=428.233..563.471 rows=24 loops=1)

  • Buffers: shared hit=19636
10. 0.038 563.326 ↑ 30.5 24 1

Nested Loop (cost=81,906.62..117,480.49 rows=733 width=993) (actual time=428.219..563.326 rows=24 loops=1)

  • Buffers: shared hit=19548
11. 0.054 563.192 ↑ 30.5 24 1

Nested Loop (cost=81,906.19..116,318.12 rows=733 width=754) (actual time=428.207..563.192 rows=24 loops=1)

  • Buffers: shared hit=19472
12. 0.045 563.018 ↑ 30.5 24 1

Nested Loop (cost=81,905.77..112,555.19 rows=733 width=590) (actual time=428.193..563.018 rows=24 loops=1)

  • Buffers: shared hit=19376
13. 0.032 562.853 ↑ 30.5 24 1

Nested Loop (cost=81,905.35..110,676.23 rows=733 width=483) (actual time=428.178..562.853 rows=24 loops=1)

  • Buffers: shared hit=19280
14. 0.067 562.821 ↑ 30.5 24 1

Nested Loop (cost=81,905.07..109,748.76 rows=733 width=392) (actual time=428.173..562.821 rows=24 loops=1)

  • Buffers: shared hit=19280
15. 116.547 562.610 ↑ 30.5 24 1

Hash Join (cost=81,904.64..105,650.62 rows=733 width=240) (actual time=428.152..562.61 rows=24 loops=1)

  • Buffers: shared hit=19184
16. 116.125 116.125 ↓ 1.0 1,096,485 1

Seq Scan on document_invoice document_invoice (cost=0..19,626.84 rows=1,096,484 width=47) (actual time=0.015..116.125 rows=1,096,485 loops=1)

  • Buffers: shared hit=8662
17. 2.148 329.938 ↑ 2.2 4,630 1

Hash (cost=81,776.06..81,776.06 rows=10,286 width=193) (actual time=329.938..329.938 rows=4,630 loops=1)

  • Buffers: shared hit=10522
18. 8.765 327.790 ↑ 2.2 4,630 1

Bitmap Heap Scan on document_base document_base (cost=43,895.32..81,776.06 rows=10,286 width=193) (actual time=319.705..327.79 rows=4,630 loops=1)

  • Buffers: shared hit=10522
19. 17.964 319.025 ↓ 0.0 0 1

BitmapAnd (cost=43,895.32..43,895.32 rows=10,286 width=0) (actual time=319.025..319.025 rows=0 loops=1)

  • Buffers: shared hit=6854
20. 8.518 8.518 ↑ 1.5 47,215 1

Bitmap Index Scan on document_base_ent_id_date_formatting_f1cc9952_idx (cost=0..2,134.81 rows=70,050 width=0) (actual time=8.518..8.518 rows=47,215 loops=1)

  • Index Cond: ((document_base.ent_id = ANY ('{8210,8211,1086,1599,1600,1608,1609,1610,1611,1612,1626,1627,1628,1634,1636,1639,1640,1641,1642,1643,1677,1680,1686,1687,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,837,838,839,843,844,845,847,851,853,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,1421,1422,1423,1433}'::bigint[])) AND (document_base.date_formatting <= '2019-12-31'::date) AND (document_base.date_formatting >= '2019-01-01'::date))
  • Buffers: shared hit=759
21. 292.543 292.543 ↑ 1.0 2,229,645 1

Bitmap Index Scan on document_base_state (cost=0..41,755.12 rows=2,260,625 width=0) (actual time=292.543..292.543 rows=2,229,645 loops=1)

  • Index Cond: (document_base.state = 1)
  • Buffers: shared hit=6095
22. 0.144 0.144 ↑ 1.0 1 24

Index Scan using document_types_pkey on document_types document_types (cost=0.43..5.58 rows=1 width=152) (actual time=0.006..0.006 rows=1 loops=24)

  • Index Cond: (document_types.id = document_base.type_id)
  • Buffers: shared hit=96
23. 0.000 0.000 ↓ 0.0 0 24

Index Scan using dicts_department_pkey on dicts_department dicts_department (cost=0.28..1.26 rows=1 width=91) (actual time=0..0 rows=0 loops=24)

  • Index Cond: (document_base.department_id = dicts_department.id)
24. 0.120 0.120 ↑ 1.0 1 24

Index Scan using contragent_mol_pkey on contragent_mol contragent_mol (cost=0.42..2.55 rows=1 width=107) (actual time=0.005..0.005 rows=1 loops=24)

  • Index Cond: (document_base.mol_id = contragent_mol.id)
  • Buffers: shared hit=96
25. 0.120 0.120 ↑ 1.0 1 24

Index Scan using contragent_supplier_pkey on contragent_supplier contragent_supplier (cost=0.43..5.12 rows=1 width=164) (actual time=0.005..0.005 rows=1 loops=24)

  • Index Cond: (document_base.supplier_id = contragent_supplier.id)
  • Buffers: shared hit=96
26. 0.096 0.096 ↑ 1.0 1 24

Index Scan using contragent_corporation_pkey on contragent_corporation contragent_corporation (cost=0.42..1.58 rows=1 width=239) (actual time=0.004..0.004 rows=1 loops=24)

  • Index Cond: (contragent_supplier.corporation_id = contragent_corporation.id)
  • Buffers: shared hit=76
27. 0.096 0.096 ↑ 1.0 1 24

Index Scan using kbk_pkey on kbk kbk (cost=0.42..4.74 rows=1 width=193) (actual time=0.004..0.004 rows=1 loops=24)

  • Index Cond: (document_base.kbk_id = kbk.id)
  • Buffers: shared hit=88
28. 0.096 0.096 ↑ 1.0 1 24

Index Scan using kbk_activity_type_pkey on kbk_activity_type kbk_activity_type (cost=0.29..1.64 rows=1 width=123) (actual time=0.004..0.004 rows=1 loops=24)

  • Index Cond: (document_base.kvd_id = kbk_activity_type.id)
  • Buffers: shared hit=72
29. 0.000 0.000 ↓ 0.0 0 24

Index Scan using unidictrec_pkey on unidictrec unidictrec (cost=0.43..6.62 rows=1 width=151) (actual time=0..0 rows=0 loops=24)

  • Index Cond: (document_base.kvd_analytic_id = unidictrec.id)
30. 0.000 0.000 ↓ 0.0 0 24

Index Scan using contract_pkey on contract contract (cost=0.42..1.48 rows=1 width=38) (actual time=0..0 rows=0 loops=24)

  • Index Cond: (document_invoice.contract_id = contract.id)
31. 0.024 0.024 ↓ 0.0 0 24

Index Scan using external_relation_with_document_document_id_key on external_relation_with_document external_relation_with_document (cost=0.15..0.58 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=24)

  • Index Cond: (document_base.id = external_relation_with_document.document_id)
  • Buffers: shared hit=24
32. 0.000 0.000 ↓ 0.0 0 24

Index Scan using doc_external_relation_pkey on doc_external_relation doc_external_relation (cost=0.15..0.58 rows=1 width=266) (actual time=0..0 rows=0 loops=24)

  • Index Cond: (external_relation_with_document.externalrelation_ptr_id = doc_external_relation.id)