explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RLGr

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 4,692.606 ↓ 15.0 15 1

Limit (cost=104,492.73..104,492.77 rows=1 width=141) (actual time=4,692.599..4,692.606 rows=15 loops=1)

2. 0.006 4,692.605 ↓ 15.0 15 1

Unique (cost=104,492.73..104,492.77 rows=1 width=141) (actual time=4,692.599..4,692.605 rows=15 loops=1)

3. 3.545 4,692.599 ↓ 21.0 21 1

Sort (cost=104,492.73..104,492.73 rows=1 width=141) (actual time=4,692.599..4,692.599 rows=21 loops=1)

  • Sort Key: (to_char(pojazd_praca_raport.data_importu, 'YYYY-MM-DD'::text)), pojazd_praca_raport.pojazd_id, pojazd_praca_raport.data_importu, pojazd_praca_raport.data_startu_pracy, pojazd_praca_raport.data_konca_pracy, (to_char((((pojazd_praca_raport.suma_czasu_pracy)::text || 'seconds'::text))::interval, 'HH24:MI:SS'::text)), pojazd_praca_raport.data_startu_pracy_pastylka, pojazd_praca_raport.data_konca_pracy_pastylka, (to_char((((pojazd_praca_raport.suma_czasu_pracy_pastylka)::text || 'seconds'::text))::interval, 'HH24:MI:SS'::text)), (string_agg(COALESCE((((kierowca.imie)::text || ' '::text) || (kierowca.nazwisko)::text), '---'::text), '<br>'::text) OVER (?)), firma1.nazwa, marka.nazwa, (CASE WHEN (pojazd.pokazuj_nr_rejestracyjny = 1) THEN pojazd.nr_rejestracyjny ELSE ''::character varying END), (CASE WHEN (pojazd.pokazuj_nr_boczny = 1) THEN pojazd.nr_boczny_pojazdu ELSE ''::character varying END), pojazd.model
  • Sort Method: quicksort Memory: 516kB
4. 3.014 4,689.054 ↓ 1,738.0 1,738 1

WindowAgg (cost=104,492.66..104,492.72 rows=1 width=141) (actual time=4,686.006..4,689.054 rows=1,738 loops=1)

5. 0.976 4,686.040 ↓ 1,738.0 1,738 1

Sort (cost=104,492.66..104,492.66 rows=1 width=141) (actual time=4,685.985..4,686.040 rows=1,738 loops=1)

  • Sort Key: pojazd_praca_raport.pojazd_praca_raport_id
  • Sort Method: quicksort Memory: 510kB
6. 0.000 4,685.064 ↓ 1,738.0 1,738 1

Nested Loop Semi Join (cost=9.76..104,492.65 rows=1 width=141) (actual time=418.819..4,685.064 rows=1,738 loops=1)

7. 0.768 4,676.749 ↓ 1,738.0 1,738 1

Nested Loop Semi Join (cost=9.05..104,474.87 rows=1 width=145) (actual time=418.799..4,676.749 rows=1,738 loops=1)

8. 992.922 4,674.243 ↓ 1,738.0 1,738 1

Nested Loop Left Join (cost=8.76..104,466.55 rows=1 width=149) (actual time=418.787..4,674.243 rows=1,738 loops=1)

  • Join Filter: (kierowca.kierowca_id = kierowca_kod.kierowca_id)
  • Rows Removed by Join Filter: 28,001,153
9. 974.524 2,092.789 ↓ 1,738.0 1,738 1

Nested Loop Left Join (cost=8.76..103,894.85 rows=1 width=141) (actual time=417.113..2,092.789 rows=1,738 loops=1)

  • Join Filter: ((kierowca_kod.kod_identyfikatora)::text = (pojazd_praca_pastylka_raport.pastylka)::text)
  • Rows Removed by Join Filter: 17,230,694
10. 8.550 506.286 ↓ 1,489.0 1,489 1

Nested Loop Left Join (cost=8.76..103,514.45 rows=1 width=183) (actual time=415.994..506.286 rows=1,489 loops=1)

  • Join Filter: (pojazd.marka_id = marka.marka_id)
  • Rows Removed by Join Filter: 174,213
11. 0.173 491.780 ↓ 1,489.0 1,489 1

Nested Loop (cost=8.76..103,510.82 rows=1 width=180) (actual time=415.987..491.780 rows=1,489 loops=1)

12. 0.148 488.629 ↓ 1,489.0 1,489 1

Nested Loop (cost=8.47..103,502.49 rows=1 width=143) (actual time=415.976..488.629 rows=1,489 loops=1)

13. 0.052 0.052 ↑ 1.0 1 1

Seq Scan on firma1 (cost=0.00..23.32 rows=1 width=37) (actual time=0.050..0.052 rows=1 loops=1)

  • Filter: (firma1_id = 389)
  • Rows Removed by Filter: 345
14. 265.793 488.429 ↓ 1,489.0 1,489 1

Hash Right Join (cost=8.47..103,479.15 rows=1 width=110) (actual time=415.924..488.429 rows=1,489 loops=1)

  • Hash Cond: (pojazd_praca_pastylka_raport.pojazd_praca_raport_id = pojazd_praca_raport.pojazd_praca_raport_id)
15. 222.209 222.209 ↑ 1.0 5,143,322 1

Seq Scan on pojazd_praca_pastylka_raport (cost=0.00..84,183.22 rows=5,143,322 width=54) (actual time=0.015..222.209 rows=5,143,322 loops=1)

16. 0.195 0.427 ↓ 1,395.0 1,395 1

Hash (cost=8.45..8.45 rows=1 width=60) (actual time=0.427..0.427 rows=1,395 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 134kB
17. 0.232 0.232 ↓ 1,395.0 1,395 1

Index Scan using pojazd_praca_raport_firma1_id_data_importu on pojazd_praca_raport (cost=0.43..8.45 rows=1 width=60) (actual time=0.008..0.232 rows=1,395 loops=1)

  • Index Cond: ((firma1_id = 389) AND (data_importu >= '2019-12-01 00:00:00'::timestamp without time zone) AND (data_importu <= '2019-12-09 00:00:00'::timestamp without time zone))
18. 2.978 2.978 ↑ 1.0 1 1,489

Index Scan using pojazd_pkey on pojazd (cost=0.30..8.32 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=1,489)

  • Index Cond: (pojazd_id = pojazd_praca_raport.pojazd_id)
19. 5.956 5.956 ↓ 1.0 118 1,489

Seq Scan on marka (cost=0.00..2.17 rows=117 width=11) (actual time=0.001..0.004 rows=118 loops=1,489)

20. 611.979 611.979 ↑ 1.0 11,573 1,489

Seq Scan on kierowca_kod (cost=0.00..235.18 rows=11,618 width=20) (actual time=0.001..0.411 rows=11,573 loops=1,489)

21. 1,588.532 1,588.532 ↑ 1.0 16,112 1,738

Seq Scan on kierowca (cost=0.00..370.20 rows=16,120 width=20) (actual time=0.001..0.914 rows=16,112 loops=1,738)

22. 1.738 1.738 ↑ 1.0 1 1,738

Index Only Scan using auser_firma_index01 on auser_firma (cost=0.29..8.31 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1,738)

  • Index Cond: ((auser_id = 2,620) AND (firma1_id = 389))
  • Heap Fetches: 1,738
23. 1.738 8.690 ↑ 1.0 1 1,738

Nested Loop Semi Join (cost=0.71..9.23 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1,738)

24. 1.738 1.738 ↑ 2.0 1 1,738

Index Scan using grupa_pojazdow_pojazd_pojazd_id on grupa_pojazdow_pojazd (cost=0.29..0.33 rows=2 width=16) (actual time=0.001..0.001 rows=1 loops=1,738)

  • Index Cond: (pojazd_id = pojazd.pojazd_id)
25. 5.214 5.214 ↑ 1.0 1 1,738

Index Scan using auser_grupa_pojazdow_grupa_pojazdow_id on auser_grupa_pojazdow (cost=0.42..3.11 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1,738)

  • Index Cond: (grupa_pojazdow_id = grupa_pojazdow_pojazd.grupa_pojazdow_id)
  • Filter: (auser_id = 2,620)
  • Rows Removed by Filter: 2
Planning time : 1.940 ms
Execution time : 4,692.724 ms