explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z2i

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 31.329 ↓ 0.0 0 1

Limit (cost=129,041.24..129,041.25 rows=1 width=1,772) (actual time=31.329..31.329 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
2. 0.017 31.327 ↓ 0.0 0 1

Sort (cost=129,041.24..129,041.25 rows=1 width=1,772) (actual time=31.327..31.327 rows=0 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_base.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=9361 read=96
3. 0.001 31.310 ↓ 0.0 0 1

Nested Loop (cost=4.25..129,041.23 rows=1 width=1,772) (actual time=31.31..31.31 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
4. 0.001 31.309 ↓ 0.0 0 1

Nested Loop (cost=4.25..129,025.16 rows=1 width=1,506) (actual time=31.309..31.309 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
5. 0.000 31.308 ↓ 0.0 0 1

Nested Loop (cost=4.25..128,964.31 rows=1 width=1,498) (actual time=31.308..31.308 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
6. 0.001 31.308 ↓ 0.0 0 1

Nested Loop (cost=3.83..128,962.82 rows=1 width=1,460) (actual time=31.308..31.308 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
7. 0.000 31.307 ↓ 0.0 0 1

Nested Loop (cost=3.4..128,958.84 rows=1 width=1,309) (actual time=31.307..31.307 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
8. 0.001 31.307 ↓ 0.0 0 1

Nested Loop (cost=3.11..128,957.46 rows=1 width=1,186) (actual time=31.307..31.307 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
9. 0.001 31.306 ↓ 0.0 0 1

Nested Loop (cost=2.69..128,955.06 rows=1 width=993) (actual time=31.306..31.306 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
10. 0.001 31.305 ↓ 0.0 0 1

Nested Loop (cost=2.26..128,953.48 rows=1 width=754) (actual time=31.305..31.305 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
11. 4.960 31.304 ↓ 0.0 0 1

Nested Loop (cost=1.83..128,950.8 rows=1 width=590) (actual time=31.304..31.304 rows=0 loops=1)

  • Buffers: shared hit=9361 read=96
12. 4.408 4.408 ↑ 4.5 48 1

Seq Scan on dicts_department dicts_department (cost=0..532.12 rows=217 width=91) (actual time=0.193..4.408 rows=48 loops=1)

  • Filter: (dicts_department.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[]))
  • Buffers: shared hit=40
13. 4.399 21.936 ↓ 775.0 775 48

Materialize (cost=1.83..128,415.42 rows=1 width=499) (actual time=0.007..0.457 rows=775 loops=48)

  • Buffers: shared hit=9321 read=96
14. 0.643 17.537 ↓ 775.0 775 1

Nested Loop (cost=1.83..128,415.42 rows=1 width=499) (actual time=0.331..17.537 rows=775 loops=1)

  • Buffers: shared hit=9321 read=96
15. 0.995 12.244 ↓ 775.0 775 1

Nested Loop (cost=1.41..128,413.46 rows=1 width=452) (actual time=0.317..12.244 rows=775 loops=1)

  • Buffers: shared hit=6217 read=96
16. 0.670 8.149 ↓ 38.8 775 1

Nested Loop (cost=0.99..128,376.98 rows=20 width=345) (actual time=0.265..8.149 rows=775 loops=1)

  • Buffers: shared hit=3116 read=96
17. 1.746 1.746 ↑ 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.024..1.746 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
18. 5.733 5.733 ↑ 1.0 2 441

Index Scan using document_base_ent_id_date_formatting_state_type_idx on document_base document_base (cost=0.56..281.92 rows=2 width=193) (actual time=0.008..0.013 rows=2 loops=441)

  • Index Cond: ((document_base.type_id = document_types.id) AND (document_base.date_formatting <= '2019-12-31'::date) AND (document_base.date_formatting >= '2019-01-01'::date))
  • Filter: ((document_base.state <> 4) AND (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[])))
  • Buffers: shared hit=2448 read=96
19. 3.100 3.100 ↑ 1.0 1 775

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

  • Index Cond: (contragent_mol.id = document_base.mol_id)
  • Filter: (contragent_mol.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[]))
  • Buffers: shared hit=3101
20. 4.650 4.650 ↑ 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.006..0.006 rows=1 loops=775)

  • Index Cond: (document_invoice.basedocumentmodel_ptr_id = document_base.id)
  • Buffers: shared hit=3104
21. 0.000 0.000 ↓ 0.0 0 0

Index Scan using contragent_supplier_pkey on contragent_supplier contragent_supplier (cost=0.43..2.66 rows=1 width=164) (never executed)

  • Index Cond: (document_base.supplier_id = contragent_supplier.id)
22. 0.000 0.000 ↓ 0.0 0 0

Index Scan using contragent_corporation_pkey on contragent_corporation contragent_corporation (cost=0.42..1.58 rows=1 width=239) (never executed)

  • Index Cond: (contragent_supplier.corporation_id = contragent_corporation.id)
23. 0.000 0.000 ↓ 0.0 0 0

Index Scan using kbk_pkey on kbk kbk (cost=0.42..2.39 rows=1 width=193) (never executed)

  • Index Cond: (document_base.kbk_id = kbk.id)
24. 0.000 0.000 ↓ 0.0 0 0

Index Scan using kbk_activity_type_pkey on kbk_activity_type kbk_activity_type (cost=0.29..1.37 rows=1 width=123) (never executed)

  • Index Cond: (document_base.kvd_id = kbk_activity_type.id)
25. 0.000 0.000 ↓ 0.0 0 0

Index Scan using unidictrec_pkey on unidictrec unidictrec (cost=0.43..3.97 rows=1 width=151) (never executed)

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

Index Scan using contract_pkey on contract contract (cost=0.42..1.48 rows=1 width=38) (never executed)

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

Seq Scan on external_relation_with_document external_relation_with_document (cost=0..32.6 rows=2,260 width=8) (never executed)

28. 0.000 0.000 ↓ 0.0 0 0

Seq Scan on doc_external_relation doc_external_relation (cost=0..12.7 rows=270 width=266) (never executed)