postgresql_16:6.1.15 Operator Optimization Information
PostgreSQL 16 > Server Programming > Extending SQL > Operator Optimization Information
A PostgreSQL operator definition can include several optional clauses that tell the system useful things about how the operator behaves. These clauses should be provided whenever appropriate, because they can make for considerable speedups in execution of queries that use the operator. But if you provide them, you must be sure that they are right! Incorrect use of an optimization clause can result in slow queries, subtly wrong output, or other Bad Things. You can always leave out an optimization clause if you are not sure about it; the only consequence is that queries might run slower than they need to.
Additional optimization clauses might be added in future versions of PostgreSQL. The ones described here are all the ones that release 16.15 understands.
It is also possible to attach a planner support function to the function that underlies an operator, providing another way of telling the system about the behavior of the operator. See (see postgresql_16:6.1.11) for more information.
Subsections
- postgresql_16:6.1.15.1
COMMUTATOR - postgresql_16:6.1.15.2
NEGATOR - postgresql_16:6.1.15.3
RESTRICT - postgresql_16:6.1.15.4
JOIN - postgresql_16:6.1.15.5
HASHES - postgresql_16:6.1.15.6
MERGES