explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FtxV

Settings
# exclusive inclusive rows x rows loops node
1. 1.554 20,000.737 ↑ 5.6 3,146 1

Sort (cost=59,474.36..59,518.79 rows=17,774 width=27) (actual time=20,000.661..20,000.737 rows=3,146 loops=1)

  • Sort Key: kierowca.kierowca_id, report_ecodriving_raw.datefrom
  • Sort Method: quicksort Memory: 342kB
2. 16,020.518 19,999.183 ↑ 5.6 3,146 1

Nested Loop (cost=530.25..58,219.74 rows=17,774 width=27) (actual time=124.904..19,999.183 rows=3,146 loops=1)

  • Join Filter: ((report_ecodriving_raw.driver)::text ~~* (kierowca_kod.kod_identyfikatora14)::text)
  • Rows Removed by Join Filter: 41099026
3. 42.053 2,864.785 ↓ 9.2 111,388 1

Hash Join (cost=10.27..4,116.34 rows=12,171 width=37) (actual time=0.717..2,864.785 rows=111,388 loops=1)

  • Hash Cond: ((report_ecodriving_raw.country)::text = (country.code3)::text)
4. 2,822.671 2,822.671 ↓ 9.9 121,588 1

Index Scan using report_ecodriving_raw_index01 on report_ecodriving_raw (cost=0.43..3,938.93 rows=12,228 width=37) (actual time=0.650..2,822.671 rows=121,588 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.016 0.061 ↓ 1.0 234 1

Hash (cost=6.93..6.93 rows=233 width=4) (actual time=0.061..0.061 rows=234 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.045 0.045 ↓ 1.0 234 1

Seq Scan on country (cost=0.00..6.93 rows=233 width=4) (actual time=0.007..0.045 rows=234 loops=1)

  • Filter: ((name IS NOT NULL) AND ((name)::text <> ''::text))
7. 1,109.238 1,113.880 ↓ 1.3 369 111,388

Materialize (cost=519.97..795.15 rows=292 width=18) (actual time=0.000..0.010 rows=369 loops=111,388)

8. 0.555 4.642 ↓ 1.3 369 1

Hash Join (cost=519.97..793.69 rows=292 width=18) (actual time=3.314..4.642 rows=369 loops=1)

  • Hash Cond: (kierowca_kod.kierowca_id = kierowca.kierowca_id)
9. 2.330 3.240 ↓ 1.0 11,467 1

HashAggregate (cost=289.74..403.75 rows=11,402 width=22) (actual time=2.456..3.240 rows=11,467 loops=1)

  • Group Key: kierowca_kod.kierowca_id, kierowca_kod.kod_identyfikatora14
10. 0.910 0.910 ↓ 1.0 11,467 1

Seq Scan on kierowca_kod (cost=0.00..232.49 rows=11,449 width=22) (actual time=0.004..0.910 rows=11,467 loops=1)

11. 0.034 0.847 ↑ 1.0 401 1

Hash (cost=225.10..225.10 rows=411 width=4) (actual time=0.847..0.847 rows=401 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
12. 0.166 0.813 ↑ 1.0 401 1

Bitmap Heap Scan on kierowca (cost=11.47..225.10 rows=411 width=4) (actual time=0.658..0.813 rows=401 loops=1)

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

Bitmap Index Scan on kierowca_firma1_id (cost=0.00..11.37 rows=411 width=0) (actual time=0.647..0.647 rows=401 loops=1)

  • Index Cond: (firma1_id = 152)
Planning time : 5.199 ms
Execution time : 20,000.929 ms