explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WgJX

Settings
# exclusive inclusive rows x rows loops node
1. 10,282.115 402,624.816 ↓ 57,881.0 57,881 1

Yuri Grankin, [10.09.20 14:21]Nested Loop Left Join (cost=5.28..434,399.67 rows=1 width=853) (actual time=309.475..402,624.816 rows=57,881 loops=1)

2. 97.725 269,808.624 ↓ 57,881.0 57,881 1

Nested Loop Left Join (cost=4.84..434,371.68 rows=1 width=231) (actual time=297.571..269,808.624 rows=57,881 loops=1)

3. 123.506 267,279.897 ↓ 57,881.0 57,881 1

Nested Loop (cost=4.42..434,370.05 rows=1 width=227) (actual time=296.462..267,279.897 rows=57,881 loops=1)

4. 138.826 256,572.727 ↓ 2,153.8 58,152 1

Nested Loop Left Join (cost=4.00..434,321.42 rows=27 width=133) (actual time=293.875..256,572.727 rows=58,152 loops=1)

5. 90.968 242,361.117 ↓ 2,153.8 58,152 1

Nested Loop Left Join (cost=3.56..434,256.90 rows=27 width=115) (actual time=287.990..242,361.117 rows=58,152 loops=1)

6. 186.505 203,540.917 ↓ 2,153.8 58,152 1

Nested Loop (cost=3.00..434,207.69 rows=27 width=117) (actual time=284.903..203,540.917 rows=58,152 loops=1)

7. 140.325 193,410.420 ↓ 2,076.9 58,152 1

Nested Loop (cost=2.56..434,160.65 rows=28 width=85) (actual time=284.210..193,410.420 rows=58,152 loops=1)

8. 159.515 137,851.239 ↓ 119.7 58,152 1

Nested Loop (cost=2.00..433,279.92 rows=486 width=91) (actual time=282.061..137,851.239 rows=58,152 loops=1)

9. 212.609 116,698.852 ↓ 6.8 58,152 1

Nested Loop (cost=1.57..418,902.67 rows=8,578 width=72) (actual time=280.912..116,698.852 rows=58,152 loops=1)

  • Join Filter: (decis.delo_id = delo_s.delo_id)
10. 144.039 67,289.651 ↓ 1.4 58,152 1

Nested Loop (cost=1.01..337,183.04 rows=41,845 width=50) (actual time=279.506..67,289.651 rows=58,152 loops=1)

11. 52,258.700 52,258.700 ↑ 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=277.085..52,258.700 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. 14,886.912 14,886.912 ↑ 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.255..0.256 rows=1 loops=58,152)

  • Index Cond: (delo_id = decis.delo_id)
13. 49,196.592 49,196.592 ↑ 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=0.845..0.846 rows=1 loops=58,152)

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

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

  • Index Cond: (delo_id = delo_s.delo_main_id)
15. 55,418.856 55,418.856 ↑ 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=0.951..0.953 rows=1 loops=58,152)

  • Index Cond: (delo_id = delo_s.delo_main_id)
16. 9,943.992 9,943.992 ↑ 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.171..0.171 rows=1 loops=58,152)

  • Index Cond: (docs_id = viol.docs_post_id)
17. 38,729.232 38,729.232 ↑ 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=0.663..0.666 rows=1 loops=58,152)

  • Index Cond: (docs_post_id = p.docs_id)
  • Filter: (decis_kod = '65'::numeric)
18. 14,072.784 14,072.784 ↑ 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.242..0.242 rows=1 loops=58,152)

  • Index Cond: (uchast_id = decis.uchast_id)
19. 10,583.664 10,583.664 ↑ 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.182..0.182 rows=1 loops=58,152)

  • Index Cond: (decis_id = decis.decis_id)
20. 2,431.002 2,431.002 ↓ 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.042..0.042 rows=0 loops=57,881)

  • Index Cond: (id = uch.ul_id)
21. 14,991.179 14,991.179 ↑ 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.259..0.259 rows=1 loops=57,881)

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

SubPlan (for Yuri Grankin, [10.09.20 14:21]Nested Loop Left Join)

23. 295.397 75,592.586 ↑ 1.0 1 57,881

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

24. 25,757.045 25,757.045 ↑ 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.445..0.445 rows=1 loops=57,881)

  • Index Cond: (vehs_id = viol.vehs_id)
25. 49,540.144 49,540.144 ↑ 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.854..0.856 rows=1 loops=57,874)

  • Index Cond: (id = v_1.regno_id)
26. 578.810 578.810 ↑ 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.010..0.010 rows=1 loops=57,881)

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

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

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

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

29. 289.405 11,055.271 ↓ 0.0 0 57,881

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

  • Sort Key: dc.decis_dat DESC
  • Sort Method: quicksort Memory: 25kB
30. 10,765.866 10,765.866 ↓ 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.185..0.186 rows=0 loops=57,881)

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

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

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

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

33. 173.643 19,332.254 ↑ 1.0 1 57,881

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

  • Sort Key: di.dat_stad_ispoln DESC
  • Sort Method: quicksort Memory: 25kB
34. 19,158.611 19,158.611 ↑ 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.330..0.331 rows=1 loops=57,881)

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

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

  • Filter: (uchast_status = uch.uchast_status)
  • Rows Removed by Filter: 2
36. 173.643 173.643 ↑ 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.003 rows=1 loops=57,881)

  • Filter: (id = c.status)
  • Rows Removed by Filter: 17
Planning time : 4.072 ms
Execution time : 402,635.444 ms