Running bitmap heap and index scan
In this recipe, we will be discussing bitmap heap scans and index scans.
Getting ready
PostgreSQL does not support creating bitmap indexes on tables. However, it will generate bitmap pages while scanning the index, which will be utilized during the table scan. PostgreSQL does not generate bitmap pages for every index scan, and it will only generate them if the number of fetching rows from the query is high enough. This bitmap page is unique to each query execution, and the scope of the bitmap page is the end of the query execution.
Bitmap heap scans will always be the parent node type to the bitmap index scan, which takes the bitmap pages as an input, and sorts the index pages as the physical table page order, and then fetches the tuples from the relation.
How to do it…
- For demonstration purposes, let's consider the following example, which generates the bitmap heap scan:
benchmarksql=# EXPLAIN SELECT * FROM bmsql_customer WHERE c_city ...