Introduction
Bitmap index scan helps find rows quickly by using a map of matching row locations instead of scanning each row one by one.
Jump into concepts and practice - no test required
Bitmap Index Scan on index_name -- scans the index to find matching row locations Bitmap Heap Scan on table_name -- fetches the actual rows using the bitmap
EXPLAIN SELECT * FROM employees WHERE department_id = 5;
EXPLAIN SELECT * FROM employees WHERE department_id = 5 AND salary > 50000;
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM pg_catalog.pg_class WHERE relkind = 'r' AND relpages > 1000;
Bitmap Index Scan in PostgreSQL?employees with an index on department_id, what will the Bitmap Index Scan do when you run:EXPLAIN SELECT * FROM employees WHERE department_id = 5;?Bitmap Index Scan followed by Bitmap Heap Scan, but the query is running very slowly. What could be a likely cause?