postgresql - PostgreSQL 哈希索引的时间复杂度是多少?

标签 postgresql indexing hash query-optimization

我猜创建哈希索引是 O(n),而用它来访问数据也得到 O(n),所以,它比 b-tree 索引更好?

最佳答案

来自manual :

Note: Testing has shown PostgreSQL's hash indexes to perform no better than B-tree indexes, and the index size and build time for hash indexes is much worse. Furthermore, hash index operations are not presently WAL-logged, so hash indexes might need to be rebuilt with REINDEX after a database crash. For these reasons, hash index use is presently discouraged.

手册的后续版本不再提及性能问题,只关注复制问题。

看起来使用哈希索引没有意义。

关于postgresql - PostgreSQL 哈希索引的时间复杂度是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28808753/

相关文章:

ruby - 为什么清除我的哈希值时也会清除我的哈希值数组?

python - 1.5 中的 Django 日期时间查询集

Windows PSQL 命令行 : is there a way to allow for passwordless login?

java - 如何从监听器禁用 Jcombobox 项目?

c# - 如何找到具有项目值的列表框项目索引?

indexing - 手动重建 PyCharm 索引

macos - 启动 Postgres 服务器

postgresql - 在 Postgres 中添加 NOT VALID 外键

Python 创建唯一的哈希/加密 url

php - JavaScript 中的 md5 等效项