explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NFhr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 858.732 ↓ 15.0 15 1

Limit (cost=105,700.36..105,700.40 rows=1 width=141) (actual time=858.727..858.732 rows=15 loops=1)

2. 0.003 858.732 ↓ 15.0 15 1

Unique (cost=105,700.36..105,700.40 rows=1 width=141) (actual time=858.727..858.732 rows=15 loops=1)

3. 0.308 858.729 ↓ 16.0 16 1

Sort (cost=105,700.36..105,700.36 rows=1 width=141) (actual time=858.727..858.729 rows=16 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: 73kB
4. 0.340 858.421 ↓ 182.0 182 1

WindowAgg (cost=105,700.29..105,700.35 rows=1 width=141) (actual time=858.099..858.421 rows=182 loops=1)

5. 0.102 858.081 ↓ 182.0 182 1

Sort (cost=105,700.29..105,700.29 rows=1 width=141) (actual time=858.075..858.081 rows=182 loops=1)

  • Sort Key: pojazd_praca_raport.pojazd_praca_raport_id
  • Sort Method: quicksort Memory: 73kB
6. 0.087 857.979 ↓ 182.0 182 1

Nested Loop Semi Join (cost=9.76..105,700.28 rows=1 width=141) (actual time=352.134..857.979 rows=182 loops=1)

7. 0.053 857.164 ↓ 182.0 182 1

Nested Loop Semi Join (cost=9.05..105,682.50 rows=1 width=145) (actual time=352.125..857.164 rows=182 loops=1)

8. 102.578 856.929 ↓ 182.0 182 1

Nested Loop Left Join (cost=8.76..105,674.18 rows=1 width=149) (actual time=352.121..856.929 rows=182 loops=1)

  • Join Filter: (kierowca.kierowca_id = kierowca_kod.kierowca_id)
  • Rows Removed by Join Filter: 2932232
9. 102.701 589.277 ↓ 182.0 182 1

Nested Loop Left Join (cost=8.76..105,102.48 rows=1 width=141) (actual time=350.644..589.277 rows=182 loops=1)

  • Join Filter: ((kierowca_kod.kod_identyfikatora)::text = (pojazd_praca_pastylka_raport.pastylka)::text)
  • Rows Removed by Join Filter: 1851528
10. 0.911 422.096 ↓ 160.0 160 1

Nested Loop Left Join (cost=8.76..104,722.08 rows=1 width=145) (actual time=349.591..422.096 rows=160 loops=1)

  • Join Filter: (pojazd.marka_id = marka.marka_id)
  • Rows Removed by Join Filter: 18720
11. 0.003 420.545 ↓ 160.0 160 1

Nested Loop (cost=8.76..104,718.45 rows=1 width=142) (actual time=349.586..420.545 rows=160 loops=1)

12. 0.010 420.222 ↓ 160.0 160 1

Nested Loop (cost=8.47..104,710.12 rows=1 width=105) (actual time=349.581..420.222 rows=160 loops=1)

13. 0.036 0.036 ↑ 1.0 1 1

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

  • Filter: (firma1_id = 389)
  • Rows Removed by Filter: 345
14. 220.503 420.176 ↓ 160.0 160 1

Hash Right Join (cost=8.47..104,686.78 rows=1 width=72) (actual time=349.546..420.176 rows=160 loops=1)

  • Hash Cond: (pojazd_praca_pastylka_raport.pojazd_praca_raport_id = pojazd_praca_raport.pojazd_praca_raport_id)
15. 199.620 199.620 ↑ 1.0 5,204,324 1

Seq Scan on pojazd_praca_pastylka_raport (cost=0.00..85,161.86 rows=5,204,386 width=16) (actual time=0.016..199.620 rows=5,204,324 loops=1)

16. 0.016 0.053 ↓ 157.0 157 1

Hash (cost=8.45..8.45 rows=1 width=60) (actual time=0.053..0.053 rows=157 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
17. 0.037 0.037 ↓ 157.0 157 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.009..0.037 rows=157 loops=1)

  • Index Cond: ((firma1_id = 389) AND (data_importu >= '2019-11-01 00:00:00'::timestamp without time zone) AND (data_importu <= '2019-11-01 00:00:00'::timestamp without time zone))
18. 0.320 0.320 ↑ 1.0 1 160

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

  • Index Cond: (pojazd_id = pojazd_praca_raport.pojazd_id)
19. 0.640 0.640 ↓ 1.0 118 160

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

20. 64.480 64.480 ↑ 1.0 11,573 160

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

21. 165.074 165.074 ↑ 1.0 16,112 182

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

22. 0.182 0.182 ↑ 1.0 1 182

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=182)

  • Index Cond: ((auser_id = 2620) AND (firma1_id = 389))
  • Heap Fetches: 182
23. 0.182 0.728 ↑ 1.0 1 182

Nested Loop Semi Join (cost=0.71..9.23 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=182)

24. 0.182 0.182 ↑ 2.0 1 182

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=182)

  • Index Cond: (pojazd_id = pojazd.pojazd_id)
25. 0.364 0.364 ↑ 1.0 1 182

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.002..0.002 rows=1 loops=182)

  • Index Cond: (grupa_pojazdow_id = grupa_pojazdow_pojazd.grupa_pojazdow_id)
  • Filter: (auser_id = 2620)
  • Rows Removed by Filter: 2
Planning time : 4.852 ms
Execution time : 858.839 ms