explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4lkw

Settings
# exclusive inclusive rows x rows loops node
1. 18.690 109,236.198 ↑ 3.2 11,968 1

Sort (cost=123,272.74..123,367.71 rows=37,990 width=27) (actual time=109,235.603..109,236.198 rows=11,968 loops=1)

  • Sort Key: kierowca.kierowca_id, report_ecodriving_raw.datefrom
  • Sort Method: quicksort Memory: 1320kB
2. 95,744.141 109,217.508 ↑ 3.2 11,968 1

Nested Loop (cost=539.47..120,382.97 rows=37,990 width=27) (actual time=19.538..109,217.508 rows=11,968 loops=1)

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

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

  • Hash Cond: ((report_ecodriving_raw.country)::text = (country.code3)::text)
4. 6,772.309 6,772.309 ↓ 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.076..6,772.309 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.056 0.179 ↑ 1.2 234 1

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

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

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

  • Filter: ((name IS NOT NULL) AND ((name)::text <> ''::text))
7. 6,463.115 6,479.066 ↓ 1.4 663 158,026

Materialize (cost=528.27..806.02 rows=463 width=18) (actual time=0.000..0.041 rows=663 loops=158,026)

8. 1.242 15.951 ↓ 1.4 663 1

Hash Join (cost=528.27..803.70 rows=463 width=18) (actual time=11.974..15.951 rows=663 loops=1)

  • Hash Cond: (kierowca_kod.kierowca_id = kierowca.kierowca_id)
9. 9.845 13.342 ↓ 1.0 11,479 1

HashAggregate (cost=289.74..403.75 rows=11,402 width=22) (actual time=10.580..13.342 rows=11,479 loops=1)

  • Group Key: kierowca_kod.kierowca_id, kierowca_kod.kod_identyfikatora14
10. 3.497 3.497 ↓ 1.0 11,479 1

Seq Scan on kierowca_kod (cost=0.00..232.49 rows=11,449 width=22) (actual time=0.015..3.497 rows=11,479 loops=1)

11. 0.155 1.367 ↓ 1.0 681 1

Hash (cost=230.43..230.43 rows=649 width=4) (actual time=1.367..1.367 rows=681 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
12. 1.095 1.212 ↓ 1.0 681 1

Bitmap Heap Scan on kierowca (cost=13.31..230.43 rows=649 width=4) (actual time=0.156..1.212 rows=681 loops=1)

  • Recheck Cond: (firma1_id = 346)
  • Heap Blocks: exact=99
13. 0.117 0.117 ↓ 1.0 681 1

Bitmap Index Scan on kierowca_firma1_id (cost=0.00..13.15 rows=649 width=0) (actual time=0.117..0.117 rows=681 loops=1)

  • Index Cond: (firma1_id = 346)
Planning time : 3.237 ms
Execution time : 109,237.080 ms