multiple of <varname>cpu_operator_cost</varname> should
be charged for any comparison operators invoked during index processing
(especially evaluation of the indexquals themselves).
</para>
<para>
The access costs should include all disk and CPU costs associated with
scanning the index itself, but <emphasis>not</emphasis> the costs of retrieving or
processing the parent-table rows that are identified by the index.
</para>
<para>
The <quote>start-up cost</quote> is the part of the total scan cost that
must be expended before we can begin to fetch the first row. For most
indexes this can be taken as zero, but an index type with a high start-up
cost might want to set it nonzero.
</para>
<para>
The <parameter>indexSelectivity</parameter> should be set to the estimated fraction of the parent
table rows that will be retrieved during the index scan. In the case
of a lossy query, this will typically be higher than the fraction of
rows that actually pass the given qual conditions.
</para>
<para>
The <parameter>indexCorrelation</parameter> should be set to the correlation (ranging between
-1.0 and 1.0) between the index order and the table order. This is used
to adjust the estimate for the cost of fetching rows from the parent
table.
</para>
<para>
The <parameter>indexPages</parameter> should be set to the number of leaf pages.
This is used to estimate the number of workers for parallel index scan.
</para>
<para>
When <parameter>loop_count</parameter> is greater than one, the returned numbers
should be averages expected for any one scan of the index.
</para>
<procedure>
<title>Cost Estimation</title>
<para>
A typical cost estimator will proceed as follows:
</para>
<step>
<para>
Estimate and return the fraction of parent-table rows that will be visited
based on the given qual conditions. In the absence of any index-type-specific
knowledge, use the standard optimizer function <function>clauselist_selectivity()</function>:
<programlisting>