1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>Catalog Entries for Indexes</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
12
TITLE="PostgreSQL 9.1beta1 Documentation"
13
HREF="index.html"><LINK
15
TITLE="Index Access Method Interface Definition"
16
HREF="indexam.html"><LINK
18
TITLE="Index Access Method Interface Definition"
19
HREF="indexam.html"><LINK
21
TITLE="Index Access Method Functions"
22
HREF="index-functions.html"><LINK
25
HREF="stylesheet.css"><META
26
HTTP-EQUIV="Content-Type"
27
CONTENT="text/html; charset=ISO-8859-1"><META
29
CONTENT="2011-04-27T21:20:33"></HEAD
35
SUMMARY="Header navigation table"
47
>PostgreSQL 9.1beta1 Documentation</A
56
TITLE="Index Access Method Interface Definition"
66
TITLE="Index Access Method Interface Definition"
74
>Chapter 52. Index Access Method Interface Definition</TD
80
TITLE="Index Access Method Interface Definition"
89
TITLE="Index Access Method Functions"
90
HREF="index-functions.html"
105
>52.1. Catalog Entries for Indexes</A
108
> Each index access method is described by a row in the
112
> system catalog (see
114
HREF="catalog-pg-am.html"
116
>). The principal contents of a
120
> row are references to
122
HREF="catalog-pg-proc.html"
128
entries that identify the index access
129
functions supplied by the access method. The APIs for these functions
130
are defined later in this chapter. In addition, the
134
> row specifies a few fixed properties of
135
the access method, such as whether it can support multicolumn indexes.
136
There is not currently any special support
137
for creating or deleting <TT
141
anyone able to write a new access method is expected to be competent
142
to insert an appropriate row for themselves.
145
> To be useful, an index access method must also have one or more
148
>operator families</I
155
HREF="catalog-pg-opfamily.html"
162
HREF="catalog-pg-opclass.html"
169
HREF="catalog-pg-amop.html"
176
HREF="catalog-pg-amproc.html"
182
These entries allow the planner
183
to determine what kinds of query qualifications can be used with
184
indexes of this access method. Operator families and classes are described
188
>, which is prerequisite material for reading
192
> An individual index is defined by a
194
HREF="catalog-pg-class.html"
200
entry that describes it as a physical relation, plus a
202
HREF="catalog-pg-index.html"
208
entry that shows the logical content of the index — that is, the set
209
of index columns it has and the semantics of those columns, as captured by
210
the associated operator classes. The index columns (key values) can be
211
either simple columns of the underlying table or expressions over the table
212
rows. The index access method normally has no interest in where the index
213
key values come from (it is always handed precomputed key values) but it
214
will be very interested in the operator class information in
218
>. Both of these catalog entries can be
219
accessed as part of the <TT
222
> data structure that is
223
passed to all operations on the index.
226
> Some of the flag columns of <TT
230
implications. The requirements of <TT
235
HREF="index-unique-checks.html"
241
> flag asserts that the
242
access method supports multicolumn indexes, while
246
> asserts that it allows scans
247
where no indexable restriction clause is given for the first index column.
255
> essentially says whether the
256
access method supports full-index scans without any restriction clause.
257
Access methods that support multiple index columns <SPAN
264
support scans that omit restrictions on any or all of the columns after
265
the first; however they are permitted to require some restriction to
266
appear for the first index column, and this is signaled by setting
271
One reason that an index AM might set
275
> false is if it doesn't index
276
NULLs. Since most indexable operators are
277
strict and hence cannot return TRUE for NULL inputs,
278
it is at first sight attractive to not store index entries for null values:
279
they could never be returned by an index scan anyway. However, this
280
argument fails when an index scan has no restriction clause for a given
281
index column. In practice this means that
282
indexes that have <TT
286
index nulls, since the planner might decide to use such an index
287
with no scan keys at all. A related restriction is that an index
288
access method that supports multiple index columns <SPAN
295
support indexing null values in columns after the first, because the planner
296
will assume the index can be used for queries that do not restrict
297
these columns. For example, consider an index on (a,b) and a query with
301
>. The system will assume the index can be
302
used to scan for rows with <TT
305
>, which is wrong if the
306
index omits rows where <TT
310
It is, however, OK to omit rows where the first indexed column is null.
311
An index access method that does index nulls may also set
315
>, indicating that it supports
331
SUMMARY="Footer navigation table"
360
HREF="index-functions.html"
370
>Index Access Method Interface Definition</TD
384
>Index Access Method Functions</TD
b'\\ No newline at end of file'