458
458
<row>
459
459
<entry>
460
460
Compute the 64-bit hash value for a key given a 64-bit salt; if
461
- the salt is 0, the low 32 bits will match the value that would
462
- have been computed by function 1
461
+ the salt is 0, the low 32 bits of the result must match the value
462
+ that would have been computed by function 1
463
+ (optional)
463
464
</entry>
464
465
<entry>2</entry>
465
466
</row>
@@ -1139,16 +1140,11 @@ ALTER OPERATOR FAMILY integer_ops USING btree ADD
1139
1140
ordering.
1140
1141
</para>
1141
1142
1142
- <para>
1143
- Comparison of arrays of user-defined types also relies on the semantics
1144
- defined by the default B-tree operator class.
1145
- </para>
1146
-
1147
1143
<para>
1148
1144
If there is no default B-tree operator class for a data type, the system
1149
1145
will look for a default hash operator class. But since that kind of
1150
- operator class only provides equality, in practice it is only enough
1151
- to support array equality .
1146
+ operator class only provides equality, it is only able to support grouping
1147
+ not sorting .
1152
1148
</para>
1153
1149
1154
1150
<para>
@@ -1168,7 +1164,25 @@ ALTER OPERATOR FAMILY integer_ops USING btree ADD
1168
1164
</note>
1169
1165
1170
1166
<para>
1171
- Another important point is that an operator that
1167
+ Sorting by a non-default B-tree operator class is possible by specifying
1168
+ the class's less-than operator in a <literal>USING</literal> option,
1169
+ for example
1170
+ <programlisting>
1171
+ SELECT * FROM mytable ORDER BY somecol USING ~<~;
1172
+ </programlisting>
1173
+ Alternatively, specifying the class's greater-than operator
1174
+ in <literal>USING</literal> selects a descending-order sort.
1175
+ </para>
1176
+
1177
+ <para>
1178
+ Comparison of arrays of a user-defined type also relies on the semantics
1179
+ defined by the type's default B-tree operator class. If there is no
1180
+ default B-tree operator class, but there is a default hash operator class,
1181
+ then array equality is supported, but not ordering comparisons.
1182
+ </para>
1183
+
1184
+ <para>
1185
+ Another important point is that an equality operator that
1172
1186
appears in a hash operator family is a candidate for hash joins,
1173
1187
hash aggregation, and related optimizations. The hash operator family
1174
1188
is essential here since it identifies the hash function(s) to use.
0 commit comments