官术网_书友最值得收藏!

Hash indexes

Hash indexes have been around for many years. The idea is to hash the input value and store it for later lookups. Having hash indexes actually makes sense. However, before PostgreSQL 10.0, it was not advised to use hash indexes because PostgreSQL had no WAL support for them. In PostgreSQL 10.0, this has changed. Hash indexes are now fully logged and are therefore ready for replication and are considered to be a 100% crash safe.

Hash indexes are generally a bit larger than b-tree indexes. Suppose you want to index 4 million integer values. A btree will need around 90 MB of storage to do this. A hash index will need around 125 MB on disk. The assumption made by many people that a hash is super small on the disk is therefore, in many cases, just wrong.

主站蜘蛛池模板: 清苑县| 昌都县| 鄱阳县| 宣武区| 堆龙德庆县| 屯昌县| 碌曲县| 家居| 中江县| 贵州省| 库尔勒市| 遵化市| 博湖县| 怀柔区| 丹凤县| 安岳县| 崇仁县| 图木舒克市| 外汇| 永福县| 昌平区| 曲水县| 庐江县| 鹿泉市| 福清市| 民勤县| 江西省| 环江| 河池市| 武邑县| 饶平县| 浮山县| 凤阳县| 高安市| 四平市| 揭阳市| 临城县| 绥滨县| 嘉峪关市| 南陵县| 商洛市|