#1 | Limit | |
#2 | └ HashAggregate | |
#3 | └ Bitmap Heap Scan | |
#4 | └ Bitmap Index Scan |
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