explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S2KQ

Settings
# exclusive inclusive rows x rows loops node
1. 8.526 72,031.019 ↑ 5.4 4,471 1

Sort (cost=79,992.89..80,052.74 rows=23,941 width=27) (actual time=72,030.581..72,031.019 rows=4,471 loops=1)

  • Sort Key: kierowca.kierowca_id, report_ecodriving_raw.datefrom
  • Sort Method: quicksort Memory: 542kB
2. 61,331.046 72,022.493 ↑ 5.4 4,471 1

Nested Loop (cost=532.59..78,251.52 rows=23,941 width=27) (actual time=128.465..72,022.493 rows=4,471 loops=1)

  • Join Filter: ((report_ecodriving_raw.driver)::text ~~* (kierowca_kod.kod_identyfikatora14)::text)
  • Rows Removed by Join Filter: 58623175
3. 228.322 6,424.745 ↓ 9.6 158,026 1

Hash Join (cost=11.20..5,527.32 rows=16,422 width=37) (actual time=0.491..6,424.745 rows=158,026 loops=1)

  • Hash Cond: ((report_ecodriving_raw.country)::text = (country.code3)::text)
4. 6,196.083 6,196.083 ↓ 10.4 171,128 1

Index Scan using report_ecodriving_raw_index01 on report_ecodriving_raw (cost=0.43..5,290.50 rows=16,489 width=37) (actual time=0.130..6,196.083 rows=171,128 loops=1)

  • Index Cond: ((datefrom >= '2019-11-01 00:00:00'::timestamp without time zone) AND (datefrom < '2019-11-28 00:00:00'::timestamp without time zone))
5. 0.123 0.340 ↑ 1.2 234 1

Hash (cost=7.39..7.39 rows=270 width=4) (actual time=0.340..0.340 rows=234 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.217 0.217 ↑ 1.2 234 1

Seq Scan on country (cost=0.00..7.39 rows=270 width=4) (actual time=0.014..0.217 rows=234 loops=1)

  • Filter: ((name IS NOT NULL) AND ((name)::text <> ''::text))
7. 4,255.648 4,266.702 ↓ 1.3 371 158,026

Materialize (cost=521.39..796.57 rows=292 width=18) (actual time=0.000..0.027 rows=371 loops=158,026)

8. 1.146 11.054 ↓ 1.3 371 1

Hash Join (cost=521.39..795.11 rows=292 width=18) (actual time=7.252..11.054 rows=371 loops=1)

  • Hash Cond: (kierowca_kod.kierowca_id = kierowca.kierowca_id)
9. 5.371 7.936 ↓ 1.0 11,481 1

HashAggregate (cost=289.74..403.75 rows=11,402 width=22) (actual time=5.236..7.936 rows=11,481 loops=1)

  • Group Key: kierowca_kod.kierowca_id, kierowca_kod.kod_identyfikatora14
10. 2.565 2.565 ↓ 1.0 11,481 1

Seq Scan on kierowca_kod (cost=0.00..232.49 rows=11,449 width=22) (actual time=0.019..2.565 rows=11,481 loops=1)

11. 0.159 1.972 ↑ 1.0 401 1

Hash (cost=226.55..226.55 rows=409 width=4) (actual time=1.972..1.972 rows=401 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
12. 1.645 1.813 ↑ 1.0 401 1

Bitmap Heap Scan on kierowca (cost=11.45..226.55 rows=409 width=4) (actual time=0.218..1.813 rows=401 loops=1)

  • Recheck Cond: (firma1_id = 152)
  • Heap Blocks: exact=91
13. 0.168 0.168 ↑ 1.0 401 1

Bitmap Index Scan on kierowca_firma1_id (cost=0.00..11.35 rows=409 width=0) (actual time=0.168..0.168 rows=401 loops=1)

  • Index Cond: (firma1_id = 152)
Planning time : 5.215 ms
Execution time : 72,031.744 ms