explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oq8V

Settings
# exclusive inclusive rows x rows loops node
1. 3,950.122 45,035.299 ↓ 3,666.0 3,666 1

Merge Right Join (cost=18,140.83..38,022.74 rows=1 width=2,268) (actual time=278.710..45,035.299 rows=3,666 loops=1)

  • Merge Cond: (delo_tags.delo_id = d.delo_id)
2. 14.382 72.398 ↓ 2.1 2,982 1

GroupAggregate (cost=0.57..9,167.46 rows=1,411 width=38) (actual time=26.408..72.398 rows=2,982 loops=1)

  • Group Key: delo_tags.delo_id
3. 58.016 58.016 ↓ 2.1 2,982 1

Index Scan using delo_tags_delo_id on delo_tags (cost=0.57..9,142.76 rows=1,412 width=11) (actual time=17.842..58.016 rows=2,982 loops=1)

  • Index Cond: ((delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
  • Filter: (card_category = '1'::numeric)
4. 13.422 40,503.205 ↓ 3,666.0 3,666 1

Materialize (cost=18,140.26..28,815.75 rows=1 width=1,827) (actual time=229.879..40,503.205 rows=3,666 loops=1)

5. 9.351 40,489.783 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,140.26..28,815.75 rows=1 width=1,827) (actual time=229.867..40,489.783 rows=3,666 loops=1)

6. 8.852 39,637.252 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,139.83..28,815.28 rows=1 width=1,777) (actual time=214.770..39,637.252 rows=3,666 loops=1)

7. 5.348 38,282.978 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,139.40..28,814.71 rows=1 width=1,761) (actual time=154.668..38,282.978 rows=3,666 loops=1)

8. 7.806 38,259.300 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,139.25..28,814.54 rows=1 width=1,738) (actual time=154.656..38,259.300 rows=3,666 loops=1)

9. 6.462 37,441.308 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,138.82..28,814.06 rows=1 width=1,640) (actual time=154.610..37,441.308 rows=3,666 loops=1)

10. 6.616 37,101.240 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,138.39..28,805.74 rows=1 width=1,614) (actual time=154.570..37,101.240 rows=3,666 loops=1)

11. 7.214 36,636.374 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,137.96..28,805.28 rows=1 width=1,603) (actual time=154.565..36,636.374 rows=3,666 loops=1)

12. 8.801 34,895.142 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,137.53..28,804.78 rows=1 width=1,590) (actual time=138.014..34,895.142 rows=3,666 loops=1)

13. 12.268 34,802.023 ↓ 3,666.0 3,666 1

Nested Loop (cost=18,137.10..28,796.38 rows=1 width=1,556) (actual time=112.237..34,802.023 rows=3,666 loops=1)

  • Join Filter: (v.delo_id = d.delo_id)
14. 6.091 9,681.321 ↓ 3,666.0 3,666 1

Nested Loop Left Join (cost=18,136.54..28,787.84 rows=1 width=1,122) (actual time=94.686..9,681.321 rows=3,666 loops=1)

15. 15.274 2,702.498 ↓ 3,666.0 3,666 1

Merge Join (cost=0.87..10,640.18 rows=1 width=694) (actual time=60.000..2,702.498 rows=3,666 loops=1)

  • Merge Cond: (v.delo_id = p.delo_id)
16. 82.313 82.313 ↓ 1.4 2,982 1

Index Scan using viol_pk on viol v (cost=0.43..2,882.07 rows=2,182 width=38) (actual time=18.836..82.313 rows=2,982 loops=1)

  • Index Cond: ((delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
17. 2,604.911 2,604.911 ↓ 1.0 3,666 1

Index Scan using docs_other_delo_id on docs_other p (cost=0.43..7,832.36 rows=3,571 width=656) (actual time=41.144..2,604.911 rows=3,666 loops=1)

  • Index Cond: ((delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
18. 28.994 6,972.732 ↓ 0.0 0 3,666

Nested Loop (cost=18,135.67..18,147.65 rows=1 width=435) (actual time=1.894..1.902 rows=0 loops=3,666)

  • Join Filter: (ds.decis_id = (max(decis.decis_id)))
  • Rows Removed by Join Filter: 50
19. 1,752.348 1,752.348 ↓ 0.0 0 3,666

Index Scan using decis_docs_other_id on decis ds (cost=0.43..7.92 rows=1 width=435) (actual time=0.477..0.478 rows=0 loops=3,666)

  • Index Cond: (p.docs_id = docs_other_id)
20. 28.999 5,191.390 ↓ 2.1 430 430

HashAggregate (cost=18,135.24..18,137.24 rows=200 width=32) (actual time=12.007..12.073 rows=430 loops=430)

  • Group Key: max(decis.decis_id)
21. 0.139 5,162.391 ↑ 1.3 430 1

GroupAggregate (cost=18,118.77..18,128.37 rows=549 width=45) (actual time=5,162.228..5,162.391 rows=430 loops=1)

  • Group Key: decis.decis_id
22. 0.960 5,162.252 ↑ 1.3 430 1

Sort (cost=18,118.77..18,120.14 rows=549 width=13) (actual time=5,162.218..5,162.252 rows=430 loops=1)

  • Sort Key: decis.decis_id
  • Sort Method: quicksort Memory: 45kB
23. 5,090.588 5,161.292 ↑ 1.3 430 1

Bitmap Heap Scan on decis (cost=147.43..18,093.78 rows=549 width=13) (actual time=83.908..5,161.292 rows=430 loops=1)

  • Recheck Cond: ((delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
  • Filter: (docs_other_id IS NOT NULL)
  • Rows Removed by Filter: 2,982
  • Heap Blocks: exact=2,474
24. 70.704 70.704 ↑ 1.4 3,413 1

Bitmap Index Scan on decis_delo_id (cost=0.00..147.29 rows=4,673 width=0) (actual time=70.704..70.704 rows=3,413 loops=1)

  • Index Cond: ((delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
25. 25,108.434 25,108.434 ↑ 1.0 1 3,666

Index Scan using delo_pkey on delo d (cost=0.56..8.52 rows=1 width=446) (actual time=6.845..6.849 rows=1 loops=3,666)

  • Index Cond: ((delo_id = p.delo_id) AND (delo_id >= '72000'::numeric) AND (delo_id <= '75000'::numeric))
26. 84.318 84.318 ↑ 1.0 1 3,666

Index Scan using uchast_pkey on uchast u (cost=0.43..8.39 rows=1 width=40) (actual time=0.023..0.023 rows=1 loops=3,666)

  • Index Cond: (v.lvok_id = uchast_id)
27. 1,734.018 1,734.018 ↑ 1.0 1 3,666

Index Scan using kart_fl_pkey on kart_fl kf (cost=0.43..0.50 rows=1 width=19) (actual time=0.473..0.473 rows=1 loops=3,666)

  • Index Cond: (u.fl_id = id)
28. 458.250 458.250 ↓ 0.0 0 3,666

Index Scan using kart_ul_pkey on kart_ul ku (cost=0.42..0.45 rows=1 width=17) (actual time=0.125..0.125 rows=0 loops=3,666)

  • Index Cond: (u.ul_id = id)
29. 333.606 333.606 ↑ 1.0 1 3,666

Index Scan using kart_place_pkey on kart_place kp (cost=0.43..8.32 rows=1 width=32) (actual time=0.090..0.091 rows=1 loops=3,666)

  • Index Cond: (v.place_nar_id = id)
30. 810.186 810.186 ↑ 1.0 1 3,666

Index Scan using kart_adr_pkey on kart_adr ka (cost=0.43..0.47 rows=1 width=110) (actual time=0.221..0.221 rows=1 loops=3,666)

  • Index Cond: (kp.adr_id = id)
31. 18.330 18.330 ↑ 1.0 1 3,666

Index Scan using kadr_region_id on kadr_region (cost=0.14..0.16 rows=1 width=28) (actual time=0.004..0.005 rows=1 loops=3,666)

  • Index Cond: (ka.region_id = region_id)
32. 1,345.422 1,345.422 ↑ 1.0 1 3,666

Index Scan using vehs_pkey on vehs v_1 (cost=0.43..0.57 rows=1 width=29) (actual time=0.346..0.367 rows=1 loops=3,666)

  • Index Cond: (vehs_id = u.vehs_id)
33. 843.180 843.180 ↑ 1.0 1 3,666

Index Scan using kart_amtc_pk on kart_amtc kt (cost=0.43..0.46 rows=1 width=71) (actual time=0.225..0.230 rows=1 loops=3,666)

  • Index Cond: (v_1.tc_id = id)
34.          

SubPlan (for Merge Right Join)

35. 421.590 421.590 ↑ 1.0 1 3,666

Index Scan using kart_docs_pkey on kart_docs kdr (cost=0.43..8.45 rows=1 width=12) (actual time=0.115..0.115 rows=1 loops=3,666)

  • Index Cond: (v_1.regno_id = id)
36. 18.330 18.330 ↑ 1.0 1 3,666

Seq Scan on avt_stiptc (cost=0.00..1.14 rows=1 width=78) (actual time=0.004..0.005 rows=1 loops=3,666)

  • Filter: ((priz_arh IS NULL) AND ((tiptc_kod)::text = (kt.tiptc_kod)::text))
  • Rows Removed by Filter: 10
37. 54.990 54.990 ↑ 1.0 1 3,666

Seq Scan on avt_stipkuz (cost=0.00..2.01 rows=1 width=30) (actual time=0.006..0.015 rows=1 loops=3,666)

  • Filter: ((priz_arh IS NULL) AND (tipkuz_kod = kt.tipkuz_kod))
  • Rows Removed by Filter: 80
38. 10.998 10.998 ↑ 1.0 1 3,666

Seq Scan on s_licence_plate_groups (cost=0.00..1.07 rows=1 width=78) (actual time=0.002..0.003 rows=1 loops=3,666)

  • Filter: (v_1.regno_group_id = id)
  • Rows Removed by Filter: 5
39. 3.666 3.666 ↓ 0.0 0 3,666

Index Scan using kart_fl_pkey on kart_fl pkf (cost=0.43..8.70 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=3,666)

  • Index Cond: (id = p.vs_fl_id)
Planning time : 60.372 ms
Execution time : 45,036.705 ms