explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OuwB

Settings
# exclusive inclusive rows x rows loops node
1. 6,422.057 1,088,276.691 ↓ 1.3 241,277 1

Nested Loop Left Join (cost=318,732.67..27,498,020.89 rows=180,671 width=2,604) (actual time=22,304.737..1,088,276.691 rows=241,277 loops=1)

2. 654.192 554,712.490 ↓ 1.3 241,277 1

Hash Left Join (cost=318,732.10..2,521,167.94 rows=180,671 width=517) (actual time=22,263.915..554,712.490 rows=241,277 loops=1)

  • Hash Cond: ((e.concatenation)::text = (osp.concatenation)::text)
3. 802.024 554,028.833 ↓ 1.3 241,277 1

Nested Loop (cost=317,513.63..2,517,502.23 rows=180,671 width=438) (actual time=22,234.281..554,028.833 rows=241,277 loops=1)

4. 675.248 515,587.597 ↓ 1.3 241,277 1

Nested Loop (cost=317,513.20..2,105,052.54 rows=180,671 width=397) (actual time=22,234.254..515,587.597 rows=241,277 loops=1)

5. 855.450 351,085.266 ↓ 1.3 241,277 1

Nested Loop (cost=317,512.64..1,659,719.04 rows=180,671 width=391) (actual time=22,232.075..351,085.266 rows=241,277 loops=1)

  • Join Filter: (e.decis_id = dio.decis_id)
6. 481.842 217,393.261 ↓ 1.4 272,765 1

Nested Loop (cost=317,512.07..945,380.86 rows=191,236 width=389) (actual time=22,225.502..217,393.261 rows=272,765 loops=1)

7. 1,155.635 30,612.924 ↓ 1.4 272,765 1

Merge Join (cost=317,511.51..473,376.68 rows=191,236 width=378) (actual time=22,218.449..30,612.924 rows=272,765 loops=1)

  • Merge Cond: (adr.id = e.debtor_adr_id)
8. 5,070.510 5,070.510 ↓ 1.0 3,096,857 1

Index Scan using kart_adr_pkey on kart_adr adr (cost=0.43..144,825.74 rows=3,081,481 width=95) (actual time=0.014..5,070.510 rows=3,096,857 loops=1)

9. 160.194 24,386.779 ↓ 1.4 272,765 1

Materialize (cost=317,507.38..318,464.48 rows=191,421 width=295) (actual time=22,218.427..24,386.779 rows=272,765 loops=1)

10. 2,538.069 24,226.585 ↓ 1.4 272,765 1

Sort (cost=317,507.38..317,985.93 rows=191,421 width=295) (actual time=22,218.425..24,226.585 rows=272,765 loops=1)

  • Sort Key: e.debtor_adr_id
  • Sort Method: external merge Disk: 76,568kB
11. 15,538.999 21,688.516 ↓ 1.4 272,765 1

Bitmap Heap Scan on docs_executive e (cost=81,400.47..285,009.84 rows=191,421 width=295) (actual time=6,162.251..21,688.516 rows=272,765 loops=1)

  • Recheck Cond: ((dat_sost >= (('now'::cstring)::date - '3 mons'::interval)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)) AND ((ogai_sost_kod)::text = '45597'::text))
  • Rows Removed by Index Recheck: 782,849
  • Heap Blocks: exact=50,660 lossy=251,602
12. 26.042 6,149.517 ↓ 0.0 0 1

BitmapAnd (cost=81,400.47..81,400.47 rows=191,421 width=0) (actual time=6,149.517..6,149.517 rows=0 loops=1)

13. 2,226.030 2,226.030 ↓ 1.1 457,118 1

Bitmap Index Scan on docs_executive_dat_sost (cost=0.00..8,378.53 rows=402,088 width=0) (actual time=2,226.030..2,226.030 rows=457,118 loops=1)

  • Index Cond: ((dat_sost >= (('now'::cstring)::date - '3 mons'::interval)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)))
14. 3,897.445 3,897.445 ↓ 1.0 2,222,025 1

Bitmap Index Scan on docs_executive_status_id_kod (cost=0.00..72,925.98 rows=2,145,293 width=0) (actual time=3,897.445..3,897.445 rows=2,222,025 loops=1)

  • Index Cond: ((ogai_sost_kod)::text = '45597'::text)
15. 186,298.495 186,298.495 ↑ 1.0 1 272,765

Index Scan using decis_pkey on decis (cost=0.56..2.46 rows=1 width=11) (actual time=0.682..0.683 rows=1 loops=272,765)

  • Index Cond: (decis_id = e.decis_id)
16. 132,836.555 132,836.555 ↑ 5.0 1 272,765

Index Scan using di_decis_stad on decis_ispoln dio (cost=0.56..3.67 rows=5 width=14) (actual time=0.487..0.487 rows=1 loops=272,765)

  • Index Cond: ((decis_id = decis.decis_id) AND (stad_ispoln_kod = '5'::numeric))
17. 163,827.083 163,827.083 ↑ 1.0 1 241,277

Index Scan using delo_pkey on delo (cost=0.56..2.45 rows=1 width=12) (actual time=0.675..0.679 rows=1 loops=241,277)

  • Index Cond: (delo_id = e.delo_id)
18. 37,639.212 37,639.212 ↑ 1.0 1 241,277

Index Scan using docs_post_pkey on docs_post t (cost=0.43..2.27 rows=1 width=53) (actual time=0.155..0.156 rows=1 loops=241,277)

  • Index Cond: (docs_id = e.docs_post_id)
19. 1.505 29.465 ↑ 1.0 2,332 1

Hash (cost=1,189.32..1,189.32 rows=2,332 width=91) (actual time=29.465..29.465 rows=2,332 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 313kB
20. 27.960 27.960 ↑ 1.0 2,332 1

Seq Scan on fsspvksp osp (cost=0.00..1,189.32 rows=2,332 width=91) (actual time=4.019..27.960 rows=2,332 loops=1)

21. 54,769.879 54,769.879 ↑ 1.0 1 241,277

Index Scan using decis_ispoln_pkey on decis_ispoln di (cost=0.56..1.87 rows=1 width=11) (actual time=0.226..0.227 rows=1 loops=241,277)

  • Index Cond: (delo.decis_ispoln_last_id = decis_ispoln_id)
22.          

SubPlan (for Nested Loop Left Join)

23. 1,087.282 240,070.615 ↑ 1.0 1 241,277

Nested Loop (cost=0.87..5.71 rows=1 width=12) (actual time=0.992..0.995 rows=1 loops=241,277)

24. 123,051.270 123,051.270 ↑ 1.0 1 241,277

Index Scan using vehs_pkey on vehs v_1 (cost=0.43..2.85 rows=1 width=6) (actual time=0.509..0.510 rows=1 loops=241,277)

  • Index Cond: (vehs_id = t.vehs_id)
25. 115,932.063 115,932.063 ↑ 1.0 1 241,023

Index Scan using kart_docs_pkey on kart_docs kdr (cost=0.43..2.85 rows=1 width=18) (actual time=0.480..0.481 rows=1 loops=241,023)

  • Index Cond: (id = v_1.regno_id)
26. 723.127 66,351.175 ↑ 11.0 1 241,277

Hash Join (cost=1.77..49.45 rows=11 width=218) (actual time=0.274..0.275 rows=1 loops=241,277)

  • Hash Cond: (ta.type_id = ts.id)
27. 65,627.344 65,627.344 ↑ 11.0 1 241,277

Index Scan using delo_tags_delo_id on delo_tags ta (cost=0.57..48.10 rows=11 width=5) (actual time=0.271..0.272 rows=1 loops=241,277)

  • Index Cond: (delo_id = delo.delo_id)
  • Filter: (type_id = ANY ('{3,4,5}'::numeric[]))
  • Rows Removed by Filter: 0
28. 0.007 0.704 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=250) (actual time=0.704..0.704 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
29. 0.697 0.697 ↑ 1.0 9 1

Seq Scan on s_stag_types ts (cost=0.00..1.09 rows=9 width=250) (actual time=0.695..0.697 rows=9 loops=1)

30. 2,171.493 2,171.493 ↑ 1.0 1 241,277

Index Scan using s_stotv_pkey on s_stotv stotv (cost=0.27..2.69 rows=1 width=15) (actual time=0.008..0.009 rows=1 loops=241,277)

  • Index Cond: (stotv_id = e.stotv_id)
31. 8,203.418 8,203.418 ↑ 1.0 1 241,277

Seq Scan on s_sasu_country country (cost=0.00..6.65 rows=1 width=25) (actual time=0.024..0.034 rows=1 loops=241,277)

  • Filter: ((code)::text = (adr.country_code)::text)
  • Rows Removed by Filter: 291
32. 4,101.709 4,101.709 ↑ 1.0 1 241,277

Seq Scan on kadr_region (cost=0.00..2.12 rows=1 width=32) (actual time=0.014..0.017 rows=1 loops=241,277)

  • Filter: ((priz_arh IS NULL) AND ((resp_kod)::text = (adr.region_kod)::text))
  • Rows Removed by Filter: 87
33. 482.554 19,784.714 ↓ 0.0 0 241,277

Limit (cost=20.81..20.81 rows=1 width=8) (actual time=0.082..0.082 rows=0 loops=241,277)

34. 1,688.939 19,302.160 ↓ 0.0 0 241,277

Sort (cost=20.81..20.85 rows=16 width=8) (actual time=0.080..0.080 rows=0 loops=241,277)

  • Sort Key: decis_ispoln.dat_stad_ispoln DESC
  • Sort Method: quicksort Memory: 25kB
35. 17,613.221 17,613.221 ↓ 0.0 0 241,277

Index Scan using di_decis_stad on decis_ispoln (cost=0.56..20.73 rows=16 width=8) (actual time=0.041..0.073 rows=0 loops=241,277)

  • Index Cond: ((e.decis_id = decis_id) AND (stad_ispoln_kod = ANY ('{11,21,22,23}'::numeric[])))
36. 1,688.939 1,688.939 ↑ 1.0 1 241,277

Seq Scan on s_sexecutive_status ss (cost=0.00..1.36 rows=1 width=138) (actual time=0.005..0.007 rows=1 loops=241,277)

  • Filter: (status_id = e.status_id)
  • Rows Removed by Filter: 28
37. 482.554 124,740.209 ↑ 1.0 1 241,277

Limit (cost=24.35..24.35 rows=1 width=102) (actual time=0.516..0.517 rows=1 loops=241,277)

38. 723.831 124,257.655 ↑ 28.0 1 241,277

Sort (cost=24.35..24.42 rows=28 width=102) (actual time=0.515..0.515 rows=1 loops=241,277)

  • Sort Key: ep.post_date DESC
  • Sort Method: quicksort Memory: 25kB
39. 715.083 123,533.824 ↑ 28.0 1 241,277

Hash Left Join (cost=13.56..24.21 rows=28 width=102) (actual time=0.407..0.512 rows=1 loops=241,277)

  • Hash Cond: (ep.spi_doc_type = dt.id)
40. 122,809.993 122,809.993 ↑ 28.0 1 241,277

Index Scan using docs_executive_post_docs_id on docs_executive_post ep (cost=0.43..10.69 rows=28 width=13) (actual time=0.404..0.509 rows=1 loops=241,277)

  • Index Cond: (docs_id = e.docs_id)
41. 0.000 8.748 ↑ 1.0 317 1

Hash (cost=9.17..9.17 rows=317 width=99) (actual time=3.835..8.748 rows=317 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 49kB
42. 16.864 16.864 ↑ 1.0 317 1

Seq Scan on s_sfssp_doc_types dt (cost=0.00..9.17 rows=317 width=99) (actual time=2.534..16.864 rows=317 loops=1)

43. 42.928 429.280 ↑ 1.0 1 21,464

Limit (cost=10.77..10.78 rows=1 width=120) (actual time=0.019..0.020 rows=1 loops=21,464)

44. 107.320 386.352 ↑ 3.0 1 21,464

Sort (cost=10.77..10.78 rows=3 width=120) (actual time=0.018..0.018 rows=1 loops=21,464)

  • Sort Key: ep_1.post_date DESC
  • Sort Method: quicksort Memory: 25kB
45. 279.032 279.032 ↑ 3.0 1 21,464

Index Scan using docs_executive_post_docs_id on docs_executive_post ep_1 (cost=0.43..10.76 rows=3 width=120) (actual time=0.011..0.013 rows=1 loops=21,464)

  • Index Cond: (docs_id = e.docs_id)
  • Filter: (spi_doc_type = '74'::numeric)
  • Rows Removed by Filter: 1
46. 219.813 2,417.943 ↑ 1.0 1 219,813

Limit (cost=10.83..10.83 rows=1 width=120) (actual time=0.011..0.011 rows=1 loops=219,813)

47. 879.252 2,198.130 ↑ 28.0 1 219,813

Sort (cost=10.83..10.90 rows=28 width=120) (actual time=0.009..0.010 rows=1 loops=219,813)

  • Sort Key: ep_2.post_date DESC
  • Sort Method: quicksort Memory: 25kB
48. 1,318.878 1,318.878 ↑ 28.0 1 219,813

Index Scan using docs_executive_post_docs_id on docs_executive_post ep_2 (cost=0.43..10.69 rows=28 width=120) (actual time=0.006..0.006 rows=1 loops=219,813)

  • Index Cond: (docs_id = e.docs_id)
49. 2,412.770 2,412.770 ↑ 1.0 1 241,277

Seq Scan on s_sstad_ispoln sdi (cost=0.00..1.60 rows=1 width=42) (actual time=0.008..0.010 rows=1 loops=241,277)

  • Filter: (stad_ispoln_kod = di.stad_ispoln_kod)
  • Rows Removed by Filter: 47
Planning time : 18.362 ms
Execution time : 1,088,335.319 ms