explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gaks

Settings
# exclusive inclusive rows x rows loops node
1. 0.256 82,379.804 ↑ 1.0 501 1

Limit (cost=5.29..486,395.24 rows=501 width=665) (actual time=2.072..82,379.804 rows=501 loops=1)

2. 4,158.374 82,379.548 ↑ 1.7 501 1

Nested Loop Left Join (cost=5.29..826,188.63 rows=851 width=665) (actual time=2.072..82,379.548 rows=501 loops=1)

  • Join Filter: (np.pnpa_id = v.pnpa_id)
  • Rows Removed by Join Filter: 111,198
3. 51.703 69,271.310 ↑ 1.7 501 1

Nested Loop Left Join (cost=5.29..792,768.58 rows=851 width=302) (actual time=0.208..69,271.310 rows=501 loops=1)

  • Join Filter: (ss.stotv_id = d.stotv_id)
  • Rows Removed by Join Filter: 223,571
4. 1.511 69,206.080 ↑ 1.7 501 1

Nested Loop Left Join (cost=5.29..786,987.26 rows=851 width=175) (actual time=0.151..69,206.080 rows=501 loops=1)

5. 7.625 69,204.569 ↑ 1.7 501 1

Nested Loop Semi Join (cost=4.72..780,002.26 rows=851 width=173) (actual time=0.151..69,204.569 rows=501 loops=1)

6. 8.364 68,937.798 ↑ 5.9 4,799 1

Nested Loop Left Join (cost=4.16..489,744.53 rows=28,355 width=179) (actual time=0.139..68,937.798 rows=4,799 loops=1)

7. 8.294 44,608.102 ↑ 5.9 4,799 1

Nested Loop Left Join (cost=3.73..472,618.27 rows=28,355 width=167) (actual time=0.130..44,608.102 rows=4,799 loops=1)

8. 6.366 43,975.938 ↑ 5.9 4,799 1

Nested Loop Left Join (cost=3.29..442,866.18 rows=28,355 width=148) (actual time=0.129..43,975.938 rows=4,799 loops=1)

9. 6.504 42,573.063 ↑ 5.9 4,799 1

Nested Loop Left Join (cost=2.87..427,606.28 rows=28,355 width=144) (actual time=0.128..42,573.063 rows=4,799 loops=1)

10. 7.863 19,157.037 ↑ 5.9 4,799 1

Nested Loop Left Join (cost=2.44..410,235.73 rows=28,355 width=126) (actual time=0.119..19,157.037 rows=4,799 loops=1)

11. 12.549 18,990.807 ↑ 5.9 4,799 1

Nested Loop (cost=2.00..387,992.56 rows=28,355 width=102) (actual time=0.109..18,990.807 rows=4,799 loops=1)

12. 14,318.429 14,318.429 ↑ 7.3 4,799 1

Index Scan Backward using delo_delo_dat_desc on delo d (cost=1.56..117,701.23 rows=34,818 width=57) (actual time=0.099..14,318.429 rows=4,799 loops=1)

  • Index Cond: (((ogai_nah_kod)::text = (apr_session_params.get_ogai_code())::text) AND (delo_dat >= to_date('2020-06-20'::text)) AND (delo_dat <= to_date('2020-07-03'::text)) AND (delo_dat >= add_months(trunc_date(current_local_time()), '-6'::numeric)))
  • Filter: (delo_tip = '1'::numeric)
13. 4,659.829 4,659.829 ↑ 1.0 1 4,799

Index Scan using viol_pk on viol v (cost=0.43..7.75 rows=1 width=51) (actual time=0.784..0.971 rows=1 loops=4,799)

  • Index Cond: (delo_id = d.delo_id)
14. 158.367 158.367 ↑ 1.0 1 4,799

Index Scan using uchast_pkey on uchast u (cost=0.43..0.77 rows=1 width=30) (actual time=0.032..0.033 rows=1 loops=4,799)

  • Index Cond: (v.lvok_id = uchast_id)
15. 23,409.522 23,409.522 ↑ 1.0 1 4,799

Index Scan using kart_fl_pkey on kart_fl kf (cost=0.43..0.60 rows=1 width=30) (actual time=4.876..4.878 rows=1 loops=4,799)

  • Index Cond: (u.fl_id = id)
16. 1,396.509 1,396.509 ↓ 0.0 0 4,799

Index Scan using kart_ul_pkey on kart_ul ku (cost=0.42..0.53 rows=1 width=17) (actual time=0.291..0.291 rows=0 loops=4,799)

  • Index Cond: (u.ul_id = id)
17. 623.870 623.870 ↑ 1.0 1 4,799

Index Scan using docs_post_pkey on docs_post dps (cost=0.43..1.04 rows=1 width=31) (actual time=0.130..0.130 rows=1 loops=4,799)

  • Index Cond: (v.docs_post_id = docs_id)
18. 24,321.332 24,321.332 ↓ 0.0 0 4,799

Index Scan using docs_prot_pkey on docs_prot dpr (cost=0.43..0.59 rows=1 width=24) (actual time=0.943..5.068 rows=0 loops=4,799)

  • Index Cond: (v.docs_prot_id = docs_id)
19. 259.146 259.146 ↓ 0.0 0 4,799

Index Scan using delo_tags_delo_id on delo_tags (cost=0.57..10.24 rows=1 width=6) (actual time=0.054..0.054 rows=0 loops=4,799)

  • Index Cond: (delo_id = v.delo_id)
  • Filter: ((card_category = '1'::numeric) AND (type_id = '4'::numeric))
  • Rows Removed by Filter: 1
20. 0.000 0.000 ↓ 0.0 0 501

Index Scan using decis_ispoln_pkey on decis_ispoln di (cost=0.56..8.20 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=501)

  • Index Cond: (d.decis_ispoln_last_id = decis_ispoln_id)
21. 13.366 13.527 ↑ 1.0 447 501

Materialize (cost=0.00..63.72 rows=448 width=139) (actual time=0.000..0.027 rows=447 loops=501)

22. 0.161 0.161 ↑ 1.0 448 1

Seq Scan on s_stotv ss (cost=0.00..61.48 rows=448 width=139) (actual time=0.004..0.161 rows=448 loops=1)

23. 6.972 7.014 ↑ 1.0 223 501

Materialize (cost=0.00..10.35 rows=223 width=115) (actual time=0.000..0.014 rows=223 loops=501)

24. 0.042 0.042 ↑ 1.0 223 1

Seq Scan on s_spnpa np (cost=0.00..9.23 rows=223 width=115) (actual time=0.003..0.042 rows=223 loops=1)

25.          

SubPlan (for Nested Loop Left Join)

26. 5,060.100 5,060.100 ↑ 1.0 1 501

Index Scan using decis_pkey on decis de (cost=0.56..8.58 rows=1 width=8) (actual time=10.053..10.100 rows=1 loops=501)

  • Index Cond: (decis_id = d.decis_first_id)
27. 27.555 27.555 ↑ 1.0 1 501

Index Scan using decis_pkey on decis de_1 (cost=0.56..8.58 rows=1 width=8) (actual time=0.055..0.055 rows=1 loops=501)

  • Index Cond: (decis_id = d.decis_last_id)
28. 2.505 3,852.189 ↑ 1.0 1 501

Nested Loop (cost=0.87..16.92 rows=1 width=12) (actual time=6.830..7.689 rows=1 loops=501)

29. 2,528.046 2,528.046 ↑ 1.0 1 501

Index Scan using vehs_pkey on vehs v_1 (cost=0.43..8.45 rows=1 width=6) (actual time=4.188..5.046 rows=1 loops=501)

  • Index Cond: (vehs_id = u.vehs_id)
30. 1,321.638 1,321.638 ↑ 1.0 1 501

Index Scan using kart_docs_pkey on kart_docs kdr (cost=0.43..8.45 rows=1 width=18) (actual time=2.637..2.638 rows=1 loops=501)

  • Index Cond: (id = v_1.regno_id)
31. 3.006 3.006 ↑ 1.0 1 501

Seq Scan on s_sstad_delo ss_1 (cost=0.00..1.09 rows=1 width=118) (actual time=0.005..0.006 rows=1 loops=501)

  • Filter: (d.stad_delo_kod = stad_delo_kod)
  • Rows Removed by Filter: 6
Planning time : 6.453 ms
Execution time : 82,380.192 ms