TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PostgreSQL's Hash Indexes Are Now Cool

214 pointsby rachbelaidover 7 years ago

8 comments

tofflosover 7 years ago
Are there any plans for allowing hash indexes in uniqueness constraints such as the ones created for primary keys? It seems like a good fit for an index that is specialized for equality checks.
评论 #15352334 未加载
评论 #15353065 未加载
misterbowfingerover 7 years ago
Wasn&#x27;t sure what a hash index was vs. btree<p>Short version - hash indexes are faster in PG11, but they only apply to &quot;where = foobar&quot; queries, giving a 0(1) time. Btree indexes have O(logn)<p>But hash indexes can&#x27;t be applied to range clauses, like &quot;where &lt; 50&quot;. You can still use a btree index however.<p>SO post:<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;398921" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;398921</a>
评论 #15352955 未加载
评论 #15352167 未加载
评论 #15352891 未加载
评论 #15354523 未加载
评论 #15353303 未加载
评论 #15354128 未加载
zitterbewegungover 7 years ago
I hope Postgres keeps on getting Cooler. Reading all the Change Logs makes me feel warm and fuzzy inside .
JohnCohornover 7 years ago
I remember someone commenting a while back that with hash indexes allowing you to navigate relationships in O(1} time, relational DBs can approximate the perf characteristics of a graph DB. When I did a quick and dirty test a couple years ago(before they would have been usable anyway due to durability and replication) I found that hash indexes performed noticeably worse than btree for navigating a few test tables with 10-100m rows each. Curious whether this is a major enough improvement for hash indexes that btree will not still be faster for many common equality lookups.
qaqover 7 years ago
Any good articles that go into detail on when to use hash indexes in PG 10?
Annatarover 7 years ago
Is it just me, or has PostgreSQL kept on getting better and better, to the point of being #1 DB in the open source market?
alexnewmanover 7 years ago
We have been talking about this for a while. Consider the coming of more distributed and nvme based storage and a lot of these things eventually make sense.
frandroidover 7 years ago
&gt; A report from a tester who goes by &quot;AP&quot; in July tipped us off to the need for a few further tweaks. AP found that trying to insert 2 billion rows into a newly-created hash index was causing an error.<p>This is what I call trying things &quot;at Indian scale&quot; :D