explain.depesz.com

PostgreSQL's explain analyze made readable

Result: exJA

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 818.105 ↓ 200.0 200 1

Limit (cost=199,635.43..199,635.44 rows=1 width=1,772) (actual time=818.022..818.105 rows=200 loops=1)

  • Buffers: shared hit=85711 read=173
2. 5.738 818.082 ↓ 200.0 200 1

Sort (cost=199,635.43..199,635.44 rows=1 width=1,772) (actual time=818.02..818.082 rows=200 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_base.id
  • Sort Method: top-N heapsort Memory: 287kB
  • Buffers: shared hit=85711 read=173
3. 1.134 812.344 ↓ 775.0 775 1

Nested Loop (cost=4,510.25..199,635.42 rows=1 width=1,772) (actual time=49.065..812.344 rows=775 loops=1)

  • Buffers: shared hit=85711 read=173
4. 2.185 811.210 ↓ 775.0 775 1

Nested Loop (cost=4,510.25..199,619.35 rows=1 width=1,506) (actual time=49.061..811.21 rows=775 loops=1)

  • Buffers: shared hit=85711 read=173
5. 1.137 809.025 ↓ 775.0 775 1

Nested Loop (cost=4,510.25..199,558.5 rows=1 width=1,498) (actual time=49.041..809.025 rows=775 loops=1)

  • Buffers: shared hit=85711 read=173
6. 1.192 807.888 ↓ 775.0 775 1

Nested Loop (cost=4,509.83..199,557.01 rows=1 width=1,460) (actual time=49.036..807.888 rows=775 loops=1)

  • Buffers: shared hit=85711 read=173
7. 0.886 806.696 ↓ 775.0 775 1

Nested Loop (cost=4,509.4..199,553.03 rows=1 width=1,309) (actual time=49.024..806.696 rows=775 loops=1)

  • Buffers: shared hit=85711 read=173
8. 1.411 776.360 ↓ 775.0 775 1

Nested Loop (cost=4,509.11..199,551.66 rows=1 width=1,186) (actual time=40.861..776.36 rows=775 loops=1)

  • Buffers: shared hit=83402 read=163
9. 1.246 771.074 ↓ 775.0 775 1

Nested Loop (cost=4,508.69..199,549.25 rows=1 width=993) (actual time=40.841..771.074 rows=775 loops=1)

  • Buffers: shared hit=80411 read=163
10. 1.505 765.178 ↓ 775.0 775 1

Nested Loop (cost=4,508.26..199,547.67 rows=1 width=754) (actual time=40.837..765.178 rows=775 loops=1)

  • Buffers: shared hit=77746 read=163
11. 1.544 758.248 ↓ 775.0 775 1

Nested Loop (cost=4,507.84..199,544.99 rows=1 width=590) (actual time=40.806..758.248 rows=775 loops=1)

  • Buffers: shared hit=74644 read=163
12. 180.187 750.504 ↓ 775.0 775 1

Nested Loop (cost=4,507.42..199,543.35 rows=1 width=483) (actual time=40.781..750.504 rows=775 loops=1)

  • Buffers: shared hit=71543 read=163
13. 1.246 387.417 ↓ 775.0 775 1

Nested Loop (cost=4,507.42..199,446.2 rows=1 width=392) (actual time=40.095..387.417 rows=775 loops=1)

  • Buffers: shared hit=40543 read=163
14. 13.501 123.446 ↓ 38.8 775 1

Hash Join (cost=4,506.99..199,406.92 rows=20 width=345) (actual time=27.518..123.446 rows=775 loops=1)

  • Buffers: shared hit=37602
15. 94.045 108.463 ↑ 1.5 47,215 1

Bitmap Heap Scan on document_base document_base (cost=2,150.45..196,788.01 rows=69,913 width=193) (actual time=25.861..108.463 rows=47,215 loops=1)

  • Buffers: shared hit=36934
16. 14.418 14.418 ↑ 1.5 47,215 1

Bitmap Index Scan on document_base_ent_id_date_formatting_state_type_idx (cost=0..2,132.97 rows=69,913 width=0) (actual time=14.418..14.418 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=768
17. 0.211 1.482 ↑ 1.0 441 1

Hash (cost=2,350.95..2,350.95 rows=447 width=152) (actual time=1.482..1.482 rows=441 loops=1)

  • Buffers: shared hit=668
18. 1.271 1.271 ↑ 1.0 441 1

Index Scan using document_types_ent_id_7f9fb2f26c3ba828 on document_types document_types (cost=0.43..2,350.95 rows=447 width=152) (actual time=0.036..1.271 rows=441 loops=1)

  • Index Cond: ((document_types.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}'::integer[])) AND ((document_types.document_code)::text = 'tov_nakl'::text))
  • Buffers: shared hit=668
19. 262.725 262.725 ↑ 1.0 1 775

Index Scan using document_invoice_pkey on document_invoice document_invoice (cost=0.43..1.95 rows=1 width=47) (actual time=0.326..0.339 rows=1 loops=775)

  • Index Cond: (document_invoice.basedocumentmodel_ptr_id = document_base.id)
  • Buffers: shared hit=2941 read=163
20. 182.900 182.900 ↑ 1.0 2,540 775

Seq Scan on dicts_department dicts_department (cost=0..65.4 rows=2,540 width=91) (actual time=0.002..0.236 rows=2,540 loops=775)

  • Buffers: shared hit=31000
21. 6.200 6.200 ↑ 1.0 1 775

Index Scan using contragent_mol_pkey on contragent_mol contragent_mol (cost=0.42..1.63 rows=1 width=107) (actual time=0.008..0.008 rows=1 loops=775)

  • Index Cond: (document_base.mol_id = contragent_mol.id)
  • Buffers: shared hit=3101
22. 5.425 5.425 ↑ 1.0 1 775

Index Scan using contragent_supplier_pkey on contragent_supplier contragent_supplier (cost=0.43..2.66 rows=1 width=164) (actual time=0.007..0.007 rows=1 loops=775)

  • Index Cond: (document_base.supplier_id = contragent_supplier.id)
  • Buffers: shared hit=3102
23. 4.650 4.650 ↑ 1.0 1 775

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

  • Index Cond: (contragent_supplier.corporation_id = contragent_corporation.id)
  • Buffers: shared hit=2665
24. 3.875 3.875 ↑ 1.0 1 775

Index Scan using kbk_pkey on kbk kbk (cost=0.42..2.39 rows=1 width=193) (actual time=0.005..0.005 rows=1 loops=775)

  • Index Cond: (document_base.kbk_id = kbk.id)
  • Buffers: shared hit=2991
25. 29.450 29.450 ↑ 1.0 1 775

Index Scan using kbk_activity_type_pkey on kbk_activity_type kbk_activity_type (cost=0.29..1.37 rows=1 width=123) (actual time=0.037..0.038 rows=1 loops=775)

  • Index Cond: (document_base.kvd_id = kbk_activity_type.id)
  • Buffers: shared hit=2309 read=10
26. 0.000 0.000 ↓ 0.0 0 775

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

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

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

  • Index Cond: (document_invoice.contract_id = contract.id)
28. 0.000 0.000 ↓ 0.0 0 775

Seq Scan on external_relation_with_document external_relation_with_document (cost=0..32.6 rows=2,260 width=8) (actual time=0..0 rows=0 loops=775)

29. 0.000 0.000 ↓ 0.0 0 775

Seq Scan on doc_external_relation doc_external_relation (cost=0..12.7 rows=270 width=266) (actual time=0..0 rows=0 loops=775)