summaryrefslogtreecommitdiff
path: root/doc/src/sgml/xindex.sgml
diff options
context:
space:
mode:
authorTom Lane2016-09-26 18:52:44 +0000
committerTom Lane2016-09-26 18:52:44 +0000
commitfdc9186f7ed1ead827509584f3b763f8dc332c43 (patch)
tree9c1035b2c12a690eb9bc0f526089e5efc3edf28a /doc/src/sgml/xindex.sgml
parenta4afb2b5c0b409bb175c20104b2ae9d47cf71be6 (diff)
Replace the built-in GIN array opclasses with a single polymorphic opclass.
We had thirty different GIN array opclasses sharing the same operators and support functions. That still didn't cover all the built-in types, nor did it cover arrays of extension-added types. What we want is a single polymorphic opclass for "anyarray". There were two missing features needed to make this possible: 1. We have to be able to declare the index storage type as ANYELEMENT when the opclass is declared to index ANYARRAY. This just takes a few more lines in index_create(). Although this currently seems of use only for GIN, there's no reason to make index_create() restrict it to that. 2. We have to be able to identify the proper GIN compare function for the index storage type. This patch proceeds by making the compare function optional in GIN opclass definitions, and specifying that the default btree comparison function for the index storage type will be looked up when the opclass omits it. Again, that seems pretty generically useful. Since the comparison function lookup is done in initGinState(), making use of the second feature adds an additional cache lookup to GIN index access setup. It seems unlikely that that would be very noticeable given the other costs involved, but maybe at some point we should consider making GinState data persist longer than it now does --- we could keep it in the index relcache entry, perhaps. Rather fortuitously, we don't seem to need to do anything to get this change to play nice with dump/reload or pg_upgrade scenarios: the new opclass definition is automatically selected to replace existing index definitions, and the on-disk data remains compatible. Also, if a user has created a custom opclass definition for a non-builtin type, this doesn't break that, since CREATE INDEX will prefer an exact match to opcintype over a match to ANYARRAY. However, if there's anyone out there with handwritten DDL that explicitly specifies _bool_ops or one of the other replaced opclass names, they'll need to adjust that. Tom Lane, reviewed by Enrique Meneses Discussion: <[email protected]>
Diffstat (limited to 'doc/src/sgml/xindex.sgml')
-rw-r--r--doc/src/sgml/xindex.sgml2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml
index f0b711e2ced..333a36c4562 100644
--- a/doc/src/sgml/xindex.sgml
+++ b/doc/src/sgml/xindex.sgml
@@ -288,7 +288,7 @@
have a fixed set of strategies either. Instead the support routines of
each operator class interpret the strategy numbers according to the
operator class's definition. As an example, the strategy numbers used by
- the built-in operator classes for arrays are shown in
+ the built-in operator class for arrays are shown in
<xref linkend="xindex-gin-array-strat-table">.
</para>