explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tsmt

Settings
# exclusive inclusive rows x rows loops node
1. 12,132.029 522,149.077 ↓ 57,881.0 57,881 1

Nested Loop Left Join (cost=5.28..434,401.82 rows=1 width=853) (actual time=473.276..522,149.077 rows=57,881 loops=1)

2. 127.315 365,719.715 ↓ 57,881.0 57,881 1

Nested Loop Left Join (cost=4.84..434,373.84 rows=1 width=231) (actual time=460.856..365,719.715 rows=57,881 loops=1)

3. 113.220 362,582.588 ↓ 57,881.0 57,881 1

Nested Loop (cost=4.42..434,372.20 rows=1 width=227) (actual time=460.349..362,582.588 rows=57,881 loops=1)

4. 173.536 347,408.000 ↓ 2,153.8 58,152 1

Nested Loop Left Join (cost=4.00..434,323.50 rows=27 width=133) (actual time=458.981..347,408.000 rows=58,152 loops=1)

5. 117.649 341,070.352 ↓ 2,153.8 58,152 1

Nested Loop Left Join (cost=3.56..434,258.98 rows=27 width=115) (actual time=458.414..341,070.352 rows=58,152 loops=1)

6. 208.999 282,335.487 ↓ 2,153.8 58,152 1

Nested Loop (cost=3.00..434,209.77 rows=27 width=117) (actual time=444.215..282,335.487 rows=58,152 loops=1)

7. 153.559 259,156.448 ↓ 2,076.9 58,152 1

Nested Loop (cost=2.56..434,162.73 rows=28 width=85) (actual time=444.193..259,156.448 rows=58,152 loops=1)

8. 166.484 192,128.089 ↓ 119.7 58,152 1

Nested Loop (cost=2.00..433,282.01 rows=486 width=91) (actual time=441.787..192,128.089 rows=58,152 loops=1)

9. 282.291 151,022.597 ↓ 6.8 58,152 1

Nested Loop (cost=1.57..418,904.82 rows=8,578 width=72) (actual time=440.439..151,022.597 rows=58,152 loops=1)

  • Join Filter: (decis.delo_id = delo_s.delo_id)
10. 141.456 89,331.794 ↓ 1.4 58,152 1

Nested Loop (cost=1.01..337,185.44 rows=41,845 width=50) (actual time=434.804..89,331.794 rows=58,152 loops=1)

11. 73,489.298 73,489.298 ↑ 1.3 58,152 1

Index Scan using decis_det_ogai_kod on decis (cost=0.58..185,182.24 rows=73,971 width=26) (actual time=431.140..73,489.298 rows=58,152 loops=1)

  • Index Cond: ((decis_dat >= date_trunc('year'::text, (('now'::cstring)::date)::timestamp with time zone)) AND (decis_dat <= (('now'::cstring)::date - '1 day'::interval)) AND ((ogai_sost_kod)::text = '45597'::text) AND (decis_kod = '95'::numeric))
12. 15,701.040 15,701.040 ↑ 1.0 1 58,152

Index Scan using docs_prot_delo_id on docs_prot prot (cost=0.43..2.04 rows=1 width=24) (actual time=0.268..0.270 rows=1 loops=58,152)

  • Index Cond: (delo_id = decis.delo_id)
13. 61,408.512 61,408.512 ↑ 1.0 1 58,152

Index Scan using delo_pkey on delo delo_s (cost=0.56..1.94 rows=1 width=34) (actual time=1.053..1.056 rows=1 loops=58,152)

  • Index Cond: (delo_id = prot.delo_id)
14. 40,939.008 40,939.008 ↑ 1.0 1 58,152

Index Scan using viol_pk on viol (cost=0.43..1.67 rows=1 width=19) (actual time=0.701..0.704 rows=1 loops=58,152)

  • Index Cond: (delo_id = delo_s.delo_main_id)
15. 66,874.800 66,874.800 ↑ 1.0 1 58,152

Index Scan using delo_pkey on delo delo_f (cost=0.56..1.80 rows=1 width=14) (actual time=1.146..1.150 rows=1 loops=58,152)

  • Index Cond: (delo_id = delo_s.delo_main_id)
16. 22,970.040 22,970.040 ↑ 1.0 1 58,152

Index Scan using docs_post_pkey on docs_post p (cost=0.43..1.67 rows=1 width=38) (actual time=0.394..0.395 rows=1 loops=58,152)

  • Index Cond: (docs_id = viol.docs_post_id)
17. 58,617.216 58,617.216 ↑ 1.0 1 58,152

Index Scan using decis_docs_post_id on decis shtraf (cost=0.56..1.81 rows=1 width=10) (actual time=1.004..1.008 rows=1 loops=58,152)

  • Index Cond: (docs_post_id = p.docs_id)
  • Filter: (decis_kod = '65'::numeric)
18. 6,164.112 6,164.112 ↑ 1.0 1 58,152

Index Scan using uchast_pkey on uchast uch (cost=0.43..2.38 rows=1 width=24) (actual time=0.106..0.106 rows=1 loops=58,152)

  • Index Cond: (uchast_id = decis.uchast_id)
19. 15,061.368 15,061.368 ↑ 1.0 1 58,152

Index Scan using case_decis_id_un on "case" c (cost=0.42..1.79 rows=1 width=100) (actual time=0.258..0.259 rows=1 loops=58,152)

  • Index Cond: ((decis_id = decis.decis_id) AND (decis_id IS NOT NULL))
20. 3,009.812 3,009.812 ↓ 0.0 0 57,881

Index Scan using kart_ul_pkey on kart_ul ul (cost=0.42..1.63 rows=1 width=17) (actual time=0.052..0.052 rows=0 loops=57,881)

  • Index Cond: (id = uch.ul_id)
21. 18,521.920 18,521.920 ↑ 1.0 1 57,881

Index Scan using kart_fl_pkey on kart_fl fl (cost=0.43..1.64 rows=1 width=19) (actual time=0.319..0.320 rows=1 loops=57,881)

  • Index Cond: (id = uch.fl_id)
22.          

SubPlan (for Nested Loop Left Join)

23. 294.900 81,670.091 ↑ 1.0 1 57,881

Nested Loop (cost=0.87..5.71 rows=1 width=12) (actual time=1.407..1.411 rows=1 loops=57,881)

24. 35,944.101 35,944.101 ↑ 1.0 1 57,881

Index Scan using vehs_pkey on vehs v_1 (cost=0.43..2.85 rows=1 width=6) (actual time=0.620..0.621 rows=1 loops=57,881)

  • Index Cond: (vehs_id = viol.vehs_id)
25. 45,431.090 45,431.090 ↑ 1.0 1 57,874

Index Scan using kart_docs_pkey on kart_docs kdr (cost=0.43..2.85 rows=1 width=18) (actual time=0.783..0.785 rows=1 loops=57,874)

  • Index Cond: (id = v_1.regno_id)
26. 1,099.739 1,099.739 ↑ 1.0 1 57,881

Index Scan using s_stotv_pkey on s_stotv stotv (cost=0.27..2.69 rows=1 width=15) (actual time=0.019..0.019 rows=1 loops=57,881)

  • Index Cond: (stotv_id = p.stotv_id)
27. 289.405 289.405 ↑ 1.0 1 57,881

Seq Scan on s_sstad_delo sd (cost=0.00..1.09 rows=1 width=118) (actual time=0.004..0.005 rows=1 loops=57,881)

  • Filter: (delo_s.stad_delo_kod = stad_delo_kod)
  • Rows Removed by Filter: 6
28. 115.762 15,859.394 ↓ 0.0 0 57,881

Limit (cost=10.29..10.30 rows=1 width=102) (actual time=0.274..0.274 rows=0 loops=57,881)

29. 289.405 15,743.632 ↓ 0.0 0 57,881

Sort (cost=10.29..10.30 rows=1 width=102) (actual time=0.272..0.272 rows=0 loops=57,881)

  • Sort Key: dc.decis_dat DESC
  • Sort Method: quicksort Memory: 25kB
30. 15,454.227 15,454.227 ↓ 0.0 0 57,881

Index Scan using decis_delo_id on decis dc (cost=0.56..10.28 rows=1 width=102) (actual time=0.265..0.267 rows=0 loops=57,881)

  • Index Cond: (delo_id = decis.delo_id)
  • Filter: (organ_sost_kod IS NULL)
  • Rows Removed by Filter: 1
31. 347.286 347.286 ↑ 1.0 1 57,881

Seq Scan on s_interaction_type it (cost=0.00..1.02 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=57,881)

  • Filter: (id = c.interaction_type)
  • Rows Removed by Filter: 1
32. 115.762 25,988.569 ↑ 1.0 1 57,881

Limit (cost=2.99..3.00 rows=1 width=8) (actual time=0.448..0.449 rows=1 loops=57,881)

33. 231.524 25,872.807 ↑ 1.0 1 57,881

Sort (cost=2.99..3.00 rows=1 width=8) (actual time=0.447..0.447 rows=1 loops=57,881)

  • Sort Key: di.dat_stad_ispoln DESC
  • Sort Method: quicksort Memory: 25kB
34. 25,641.283 25,641.283 ↑ 1.0 1 57,881

Index Scan using di_decis_stad on decis_ispoln di (cost=0.56..2.98 rows=1 width=8) (actual time=0.442..0.443 rows=1 loops=57,881)

  • Index Cond: ((decis_id = decis.decis_id) AND (stad_ispoln_kod = '15'::numeric))
35. 289.405 289.405 ↑ 1.0 1 57,881

Seq Scan on s_suchast_status status (cost=0.00..1.04 rows=1 width=118) (actual time=0.004..0.005 rows=1 loops=57,881)

  • Filter: (uchast_status = uch.uchast_status)
  • Rows Removed by Filter: 2
36. 231.524 231.524 ↑ 1.0 1 57,881

Seq Scan on s_case_status cs (cost=0.00..1.23 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=57,881)

  • Filter: (id = c.status)
  • Rows Removed by Filter: 17
Planning time : 3.794 ms
Execution time : 522,161.443 ms