explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ps9

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 48,385.653 ↓ 200.0 200 1

Limit (cost=290,017.39..290,017.39 rows=1 width=1,772) (actual time=48,385.575..48,385.653 rows=200 loops=1)

  • Buffers: shared hit=867119 read=40446
2. 13.795 48,385.633 ↓ 200.0 200 1

Sort (cost=290,017.39..290,017.39 rows=1 width=1,772) (actual time=48,385.573..48,385.633 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=867119 read=40446
3. 3.470 48,371.838 ↓ 775.0 775 1

Nested Loop (cost=200,118.59..290,017.38 rows=1 width=1,772) (actual time=27,624.914..48,371.838 rows=775 loops=1)

  • Buffers: shared hit=867119 read=40446
4. 7.833 48,368.368 ↓ 775.0 775 1

Nested Loop (cost=200,118.59..290,001.3 rows=1 width=1,506) (actual time=27,624.908..48,368.368 rows=775 loops=1)

  • Buffers: shared hit=867119 read=40446
5. 2.816 48,360.535 ↓ 775.0 775 1

Nested Loop (cost=200,118.59..289,940.45 rows=1 width=1,498) (actual time=27,624.891..48,360.535 rows=775 loops=1)

  • Buffers: shared hit=867119 read=40446
6. 7.391 48,356.944 ↓ 775.0 775 1

Nested Loop (cost=200,118.17..289,938.57 rows=1 width=1,460) (actual time=27,624.885..48,356.944 rows=775 loops=1)

  • Buffers: shared hit=867119 read=40446
7. 5,127.533 48,348.003 ↓ 775.0 775 1

Nested Loop (cost=200,117.74..289,934.44 rows=1 width=1,309) (actual time=27,624.87..48,348.003 rows=775 loops=1)

  • Buffers: shared hit=867119 read=40446
8. 5.396 36,439.220 ↓ 775.0 775 1

Hash Join (cost=200,117.74..287,594.23 rows=1 width=1,186) (actual time=27,613.002..36,439.22 rows=775 loops=1)

  • Buffers: shared hit=20819 read=40446
9. 6.015 36,432.089 ↑ 6.4 775 1

Nested Loop (cost=197,761.2..285,223.9 rows=4,979 width=1,186) (actual time=27,611.232..36,432.089 rows=775 loops=1)

  • Buffers: shared hit=20151 read=40446
10. 6.276 36,101.349 ↑ 6.4 775 1

Nested Loop (cost=197,760.77..271,950.77 rows=4,979 width=993) (actual time=27,611.171..36,101.349 rows=775 loops=1)

  • Buffers: shared hit=17209 read=40397
11. 4.375 32,871.073 ↑ 6.4 775 1

Nested Loop (cost=197,760.35..262,145.55 rows=4,979 width=754) (actual time=27,586.377..32,871.073 rows=775 loops=1)

  • Buffers: shared hit=15132 read=39809
12. 3.227 28,913.423 ↑ 6.4 775 1

Nested Loop (cost=197,759.92..247,717.65 rows=4,979 width=590) (actual time=27,570.573..28,913.423 rows=775 loops=1)

  • Buffers: shared hit=12789 read=39050
13. 2.827 28,109.621 ↑ 6.4 775 1

Hash Join (cost=197,759.5..237,695.26 rows=4,979 width=483) (actual time=27,548.183..28,109.621 rows=775 loops=1)

  • Buffers: shared hit=9854 read=38884
14. 5.308 28,104.679 ↑ 6.4 775 1

Nested Loop (cost=197,662.35..237,579.21 rows=4,979 width=392) (actual time=27,545.987..28,104.679 rows=775 loops=1)

  • Buffers: shared hit=9814 read=38884
15. 344.039 28,037.371 ↑ 6.4 775 1

Hash Join (cost=197,661.92..221,450.37 rows=4,979 width=240) (actual time=27,541.782..28,037.371 rows=775 loops=1)

  • Buffers: shared hit=6723 read=38873
16. 304.862 304.862 ↓ 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.016..304.862 rows=1,096,485 loops=1)

  • Buffers: shared hit=4 read=8658
17. 110.971 27,388.470 ↑ 1.5 47,215 1

Hash (cost=196,788.01..196,788.01 rows=69,913 width=193) (actual time=27,388.469..27,388.47 rows=47,215 loops=1)

  • Buffers: shared hit=6719 read=30215
18. 25,956.868 27,277.499 ↑ 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=1,332.225..27,277.499 rows=47,215 loops=1)

  • Buffers: shared hit=6719 read=30215
19. 1,320.631 1,320.631 ↑ 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=1,320.631..1,320.631 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=424 read=344
20. 62.000 62.000 ↑ 1.0 1 775

Index Scan using document_types_pkey on document_types document_types (cost=0.43..3.23 rows=1 width=152) (actual time=0.077..0.08 rows=1 loops=775)

  • Index Cond: (document_types.id = document_base.type_id)
  • Buffers: shared hit=3091 read=11
21. 1.240 2.115 ↑ 1.0 2,540 1

Hash (cost=65.4..65.4 rows=2,540 width=91) (actual time=2.115..2.115 rows=2,540 loops=1)

  • Buffers: shared hit=40
22. 0.875 0.875 ↑ 1.0 2,540 1

Seq Scan on dicts_department dicts_department (cost=0..65.4 rows=2,540 width=91) (actual time=0.027..0.875 rows=2,540 loops=1)

  • Buffers: shared hit=40
23. 800.575 800.575 ↑ 1.0 1 775

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

  • Index Cond: (document_base.mol_id = contragent_mol.id)
  • Buffers: shared hit=2935 read=166
24. 3,953.275 3,953.275 ↑ 1.0 1 775

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

  • Index Cond: (document_base.supplier_id = contragent_supplier.id)
  • Buffers: shared hit=2343 read=759
25. 3,224.000 3,224.000 ↑ 1.0 1 775

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

  • Index Cond: (contragent_supplier.corporation_id = contragent_corporation.id)
  • Buffers: shared hit=2077 read=588
26. 324.725 324.725 ↑ 1.0 1 775

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

  • Index Cond: (document_base.kbk_id = kbk.id)
  • Buffers: shared hit=2942 read=49
27. 0.165 1.735 ↑ 1.0 441 1

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

  • Buffers: shared hit=668
28. 1.570 1.570 ↑ 1.0 441 1

Index Scan using document_types_ent_id_7f9fb2f26c3ba828 on document_types document_types_1 (cost=0.43..2,350.95 rows=447 width=4) (actual time=0.04..1.57 rows=441 loops=1)

  • Index Cond: ((document_types_1.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_1.document_code)::text = 'tov_nakl'::text))
  • Buffers: shared hit=668
29. 6,781.250 6,781.250 ↑ 1.0 55,476 775

Seq Scan on kbk_activity_type kbk_activity_type (cost=0..1,646.76 rows=55,476 width=123) (actual time=0.007..8.75 rows=55,476 loops=775)

  • Buffers: shared hit=846300
30. 1.550 1.550 ↓ 0.0 0 775

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

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

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

  • Index Cond: (document_invoice.contract_id = contract.id)
32. 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)

33. 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)