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

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 advisable 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 considered to be 100% crash-safe.

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

主站蜘蛛池模板: 綦江县| 松溪县| 米泉市| 讷河市| 探索| 改则县| 淮阳县| 卓资县| 赫章县| 泸定县| 合山市| 喀什市| 梁平县| 广宗县| 从化市| 东城区| 成武县| 马龙县| 三河市| 永定县| 石台县| 天峻县| 巴彦淖尔市| 洛隆县| 米脂县| 新营市| 徐闻县| 呼伦贝尔市| 巨野县| 洛宁县| 潜江市| 丹巴县| 西林县| 石首市| 桃源县| 望奎县| 靖江市| 云和县| 大庆市| 阿拉善右旗| 东港市|