aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml15
-rw-r--r--doc/src/sgml/indexam.sgml24
2 files changed, 24 insertions, 15 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index b8cc16f72a9..d948ed487c6 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -482,13 +482,6 @@
</row>
<row>
- <entry><structfield>amcanreturn</structfield></entry>
- <entry><type>bool</type></entry>
- <entry></entry>
- <entry>Can the access method return the contents of index entries?</entry>
- </row>
-
- <row>
<entry><structfield>amoptionalkey</structfield></entry>
<entry><type>bool</type></entry>
<entry></entry>
@@ -623,6 +616,14 @@
</row>
<row>
+ <entry><structfield>amcanreturn</structfield></entry>
+ <entry><type>regproc</type></entry>
+ <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
+ <entry>Function to check whether index supports index-only scans,
+ or zero if none</entry>
+ </row>
+
+ <row>
<entry><structfield>amcostestimate</structfield></entry>
<entry><type>regproc</type></entry>
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml
index a6e4466e8a1..ebd32cc8d97 100644
--- a/doc/src/sgml/indexam.sgml
+++ b/doc/src/sgml/indexam.sgml
@@ -134,11 +134,6 @@
<structfield>amsearchnulls</structfield>, indicating that it supports
<literal>IS NULL</> and <literal>IS NOT NULL</> clauses as search
conditions.
- An index method can also set <structfield>amcanreturn</structfield>,
- indicating that it can support <firstterm>index-only scans</> by returning
- the indexed column values for an index entry in the form of an IndexTuple.
- (An example of an index AM that cannot do this is hash, which stores only
- the hash values not the original data.)
</para>
</sect1>
@@ -278,6 +273,19 @@ amvacuumcleanup (IndexVacuumInfo *info,
<para>
<programlisting>
+bool
+amcanreturn (Relation indexRelation);
+</programlisting>
+ Check whether the index can support <firstterm>index-only scans</> by
+ returning the indexed column values for an index entry in the form of an
+ IndexTuple. Return TRUE if so, else FALSE. If the index AM can never
+ support index-only scans (an example is hash, which stores only
+ the hash values not the original data), it is sufficient to set its
+ <structfield>amcanreturn</> field to zero in <structname>pg_am</>.
+ </para>
+
+ <para>
+<programlisting>
void
amcostestimate (PlannerInfo *root,
IndexOptInfo *index,
@@ -391,9 +399,9 @@ amgettuple (IndexScanDesc scan,
</para>
<para>
- If the access method supports index-only scans (i.e.,
- <structfield>amcanreturn</structfield> is TRUE in its <structname>pg_am</>
- row), then on success it must also check
+ If the index supports index-only scans (i.e.,
+ <function>amcanreturn</function> returns TRUE for it),
+ then on success the AM must also check
<literal>scan-&gt;xs_want_itup</>, and if that is true it must return
the original indexed data for the index entry, in the form of an
<structname>IndexTuple</> pointer stored at <literal>scan-&gt;xs_itup</>,