explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1hYU

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 499.451 ↓ 15.0 15 1

Limit (cost=104,763.20..104,763.24 rows=1 width=121) (actual time=499.446..499.451 rows=15 loops=1)

2. 0.006 499.450 ↓ 15.0 15 1

Unique (cost=104,763.20..104,763.24 rows=1 width=121) (actual time=499.445..499.450 rows=15 loops=1)

3. 0.207 499.444 ↓ 15.0 15 1

Sort (cost=104,763.20..104,763.20 rows=1 width=121) (actual time=499.444..499.444 rows=15 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)), 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: 67kB
4. 38.657 499.237 ↓ 160.0 160 1

Nested Loop Semi Join (cost=9.30..104,763.19 rows=1 width=121) (actual time=423.285..499.237 rows=160 loops=1)

  • Join Filter: (pojazd.pojazd_id = get_user_vehicles_temp.get_user_vehicles_temp)
  • Rows Removed by Join Filter: 932,211
5. 0.019 424.900 ↓ 160.0 160 1

Nested Loop Semi Join (cost=9.05..104,730.40 rows=1 width=125) (actual time=412.709..424.900 rows=160 loops=1)

6. 0.787 424.721 ↓ 160.0 160 1

Nested Loop Left Join (cost=8.76..104,722.08 rows=1 width=129) (actual time=412.705..424.721 rows=160 loops=1)

  • Join Filter: (pojazd.marka_id = marka.marka_id)
  • Rows Removed by Join Filter: 18,720
7. 0.000 423.134 ↓ 160.0 160 1

Nested Loop (cost=8.76..104,718.45 rows=1 width=126) (actual time=412.700..423.134 rows=160 loops=1)

8. 0.018 422.497 ↓ 160.0 160 1

Nested Loop (cost=8.47..104,710.12 rows=1 width=89) (actual time=412.685..422.497 rows=160 loops=1)

9. 0.040 0.040 ↑ 1.0 1 1

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

  • Filter: (firma1_id = 389)
  • Rows Removed by Filter: 345
10. 219.076 422.439 ↓ 160.0 160 1

Hash Right Join (cost=8.47..104,686.78 rows=1 width=56) (actual time=412.646..422.439 rows=160 loops=1)

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

Seq Scan on pojazd_praca_pastylka_raport (cost=0.00..85,161.86 rows=5,204,386 width=4) (actual time=0.005..203.298 rows=5,204,324 loops=1)

12. 0.019 0.065 ↓ 157.0 157 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
13. 0.046 0.046 ↓ 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.020..0.046 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))
14. 0.640 0.640 ↑ 1.0 1 160

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

  • Index Cond: (pojazd_id = pojazd_praca_raport.pojazd_id)
15. 0.800 0.800 ↓ 1.0 118 160

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

16. 0.160 0.160 ↑ 1.0 1 160

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

  • Index Cond: ((auser_id = 2,620) AND (firma1_id = 389))
  • Heap Fetches: 160
17. 35.680 35.680 ↓ 5.8 5,827 160

Function Scan on get_user_vehicles_temp (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.062..0.223 rows=5,827 loops=160)

Planning time : 4.926 ms
Execution time : 499.523 ms