Execution time: 22s 874ms
Planning time: 71.6ms
#1 Limit
#2 HashAggregate
#3  └ Bitmap Heap Scan
#4   └ Bitmap Index Scan

Limit

HashAggregate

by gender

Bitmap Heap Scan

on employees as a

Bitmap Index Scan

using ix_employees_gender_lower
Limit  (cost=18384.32..18384.52 rows=20 width=108) (actual time=22856.805..22856.855 rows=1 loops=1)
  ->  HashAggregate  (cost=18384.32..18386.32 rows=200 width=108) (actual time=22856.782..22856.807 rows=1 loops=1)
        Group Key: gender
        ->  Bitmap Heap Scan on employees a  (cost=223.45..18358.21 rows=10441 width=108) (actual time=3426.767..17996.532 rows=1123728 loops=1)
              Filter: (lower((gender)::text) ~~ 'f%'::text)
              Heap Blocks: exact=21781
              ->  Bitmap Index Scan on ix_employees_gender_lower  (cost=0.00..220.84 rows=10441 width=0) (actual time=3341.010..3341.015 rows=1123728 loops=1)
                    Index Cond: ((lower((gender)::text) ~>=~ 'f'::text) AND (lower((gender)::text) ~<~ 'g'::text))
Planning Time: 71.597 ms
Execution Time: 22873.794 ms
select  a.gender from "employees" as a 
where  lower( gender ) LIKE 'f%'  group by gender
limit 20
Table Count Time
employees 1 14s 656ms 64%
#3 Bitmap Heap Scan 14s 656ms 64%
Function Count Time
No function used
Node Type Count Time
Bitmap Heap Scan 1 14s 656ms 64%
#3 Bitmap Heap Scan 14s 656ms 64%
HashAggregate 1 4s 860ms 21%
#2 HashAggregate 4s 860ms 21%
Bitmap Index Scan 1 3s 341ms 15%
#4 Bitmap Index Scan 3s 341ms 15%
Limit 1 0.048ms 0%
#1 Limit 0.048ms 0%
Index Count Time
ix_employees_gender_lower 1 3s 341ms 15%
#4 Bitmap Index Scan 3s 341ms 15%