How to create bitmap index in postgresql ? (Does it even have bitmap index ?)

邮差的信 提交于 2019-12-08 09:12:16

问题


I have been "googling" at least for an hour but I was unable to find how to create a bitmap index in postgresql, so my question is very simple how to write this command (from oracle) in postgresql

CREATE BITMAP INDEX name  ON table (column);

回答1:


The bitmap of pages is created dynamically for each query. It is not cached or re-used, and is discarded at the end of the bitmap index scan.

It doesn't make sense to create the page bitmap in advance because its contents depend on the query predicates.

Bitmap index create a separate bitmap (a sequence of 0 and 1) for each possible value of the column, where each bit corresponds to a string with an indexed value. Bitmap indexes are optimal for data where bit unique values (example, gender field)

PostgreSQL does not provide persistent bitmap index. But it can be used in database to combine multiple indexes. PostgreSQL scans each needed index and prepares a bitmap in memory giving the locations of table rows that are reported as matching that index’s conditions. The bitmaps are then ANDed and ORed together as needed by the query. Finally, the actual table rows are visited and returned.



来源:https://stackoverflow.com/questions/32112397/how-to-create-bitmap-index-in-postgresql-does-it-even-have-bitmap-index

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!