Should I use hash or btree for a foreign key index in postgresql 9.3? -


Which index would perform better for the foreign key of type integer in postgresql 9.3?

I have a hash index because foreign key comparison is always made

Or does a BTRE compare faster as a hash in use for Johns on foreign keys?

Because using the PostGracekey primary key, Btree suggests that they are even better for foreign keys.

From:

Caution Hash Index Operation Currently Val-Log , The hash index may have to be recreated with REINDEX after the database crashes, if unwritten changes occur, in addition to that, changes in the hash index are not repeated on the streaming or file-based replication after the initial base backup , So they give wrong answers to those questions which Not use them. For these reasons, use of hash index is currently discouraged.

There is no evidence that there is a benefit on BT ree in a hash index.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -