explain.depesz.com

PostgreSQL's explain analyze made readable

Result: orgC

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 958.366 ↓ 15.0 15 1

Limit (cost=320,463.25..320,463.29 rows=1 width=121) (actual time=958.361..958.366 rows=15 loops=1)

2. 0.004 958.364 ↓ 15.0 15 1

Unique (cost=320,463.25..320,463.29 rows=1 width=121) (actual time=958.360..958.364 rows=15 loops=1)

3. 0.295 958.360 ↓ 15.0 15 1

Sort (cost=320,463.25..320,463.26 rows=1 width=121) (actual time=958.360..958.360 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. 43.098 958.065 ↓ 160.0 160 1

Nested Loop Semi Join (cost=215,724.67..320,463.24 rows=1 width=121) (actual time=873.133..958.065 rows=160 loops=1)

  • Join Filter: (pojazd.pojazd_id = get_user_vehicles_temp.get_user_vehicles_temp)
  • Rows Removed by Join Filter: 932211
5. 0.048 873.687 ↓ 160.0 160 1

Nested Loop Semi Join (cost=215,724.42..320,430.45 rows=1 width=125) (actual time=859.801..873.687 rows=160 loops=1)

6. 1.045 873.479 ↓ 160.0 160 1

Nested Loop Left Join (cost=215,724.13..320,422.13 rows=1 width=129) (actual time=859.783..873.479 rows=160 loops=1)

  • Join Filter: (pojazd.marka_id = marka.marka_id)
  • Rows Removed by Join Filter: 18720
7. 0.067 871.634 ↓ 160.0 160 1

Nested Loop (cost=215,724.13..320,418.50 rows=1 width=126) (actual time=859.776..871.634 rows=160 loops=1)

8. 0.040 871.087 ↓ 160.0 160 1

Nested Loop (cost=215,723.83..320,410.17 rows=1 width=89) (actual time=859.760..871.087 rows=160 loops=1)

9. 239.293 870.887 ↓ 160.0 160 1

Hash Right Join (cost=215,723.68..320,402.00 rows=1 width=56) (actual time=859.748..870.887 rows=160 loops=1)

  • Hash Cond: (pojazd_praca_pastylka_raport.pojazd_praca_raport_id = pojazd_praca_raport.pojazd_praca_raport_id)
10. 225.784 225.784 ↑ 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.013..225.784 rows=5,204,324 loops=1)

11. 0.019 405.810 ↓ 157.0 157 1

Hash (cost=215,723.67..215,723.67 rows=1 width=60) (actual time=405.810..405.810 rows=157 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
12. 405.791 405.791 ↓ 157.0 157 1

Seq Scan on pojazd_praca_raport (cost=0.00..215,723.67 rows=1 width=60) (actual time=394.204..405.791 rows=157 loops=1)

  • Filter: ((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) AND (firma1_id = 389))
  • Rows Removed by Filter: 7503088
13. 0.160 0.160 ↑ 1.0 1 160

Index Scan using firma1_pkey on firma1 (cost=0.15..8.17 rows=1 width=37) (actual time=0.001..0.001 rows=1 loops=160)

  • Index Cond: (firma1_id = 389)
14. 0.480 0.480 ↑ 1.0 1 160

Index Scan using pojazd_pkey on pojazd (cost=0.30..8.32 rows=1 width=37) (actual time=0.003..0.003 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 = 2620) AND (firma1_id = 389))
  • Heap Fetches: 160
17. 41.280 41.280 ↓ 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.078..0.258 rows=5,827 loops=160)

Planning time : 1.653 ms
Execution time : 958.545 ms