Doc patch for index access method function

Started by Tatsuro Yamadaover 7 years ago4 messages
#1Tatsuro Yamada
yamada.tatsuro@lab.ntt.co.jp
1 attachment(s)

Hi,

Attached patch for fixing documents of "61.2. Index Access Method Functions" and
"61.6. Index Cost Estimation Functions".

I added a variable "double *indexPages" introduced by commit 5262f7a4f to the documents and
also added its explanation. Please read and revise it because I'm a non-native English speaker.

Regards,

Tatsuro Yamada
NTT Open Source Software Center

Attachments:

fix_index_access_method_doc.patchtext/x-patch; name=fix_index_access_method_doc.patchDownload
diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml
index c72c522175..2ef638dc7d 100644
--- a/doc/src/sgml/indexam.sgml
+++ b/doc/src/sgml/indexam.sgml
@@ -385,7 +385,8 @@ amcostestimate (PlannerInfo *root,
                 Cost *indexStartupCost,
                 Cost *indexTotalCost,
                 Selectivity *indexSelectivity,
-                double *indexCorrelation);
+                double *indexCorrelation,
+                double *indexPages);
 </programlisting>
    Estimate the costs of an index scan.  This function is described fully
    in <xref linkend="index-cost-estimation"/>, below.
@@ -1155,7 +1156,8 @@ amcostestimate (PlannerInfo *root,
                 Cost *indexStartupCost,
                 Cost *indexTotalCost,
                 Selectivity *indexSelectivity,
-                double *indexCorrelation);
+                double *indexCorrelation,
+                double *indexPages);
 </programlisting>
 
    The first three parameters are inputs:
@@ -1197,7 +1199,7 @@ amcostestimate (PlannerInfo *root,
   </para>
 
   <para>
-   The last four parameters are pass-by-reference outputs:
+   The last five parameters are pass-by-reference outputs:
 
    <variablelist>
     <varlistentry>
@@ -1236,6 +1238,15 @@ amcostestimate (PlannerInfo *root,
       </para>
      </listitem>
     </varlistentry>
+
+    <varlistentry>
+     <term><parameter>*indexPages</parameter></term>
+     <listitem>
+      <para>
+       Set to number of index leaf pages
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
   </para>
 
@@ -1283,6 +1294,11 @@ amcostestimate (PlannerInfo *root,
    table.
   </para>
 
+  <para>
+   The <parameter>indexPages</parameter> should be set to the number of leaf pages.  This is used
+   to adjust the estimate for the cost of the disk access. 
+  </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.
#2Alexander Korotkov
a.korotkov@postgrespro.ru
In reply to: Tatsuro Yamada (#1)
Re: Doc patch for index access method function

Hi!

On Fri, Aug 10, 2018 at 6:24 AM Tatsuro Yamada
<yamada.tatsuro@lab.ntt.co.jp> wrote:

Attached patch for fixing documents of "61.2. Index Access Method Functions" and
"61.6. Index Cost Estimation Functions".

I added a variable "double *indexPages" introduced by commit 5262f7a4f to the documents and
also added its explanation. Please read and revise it because I'm a non-native English speaker.

Good catch. It was overseen in 5262f7a4fc44, where parallel index
scan was introduced.

"This is used to adjust the estimate for the cost of the disk access."

This sentence doesn't look correct for me. Cost of the disk access is
estimated inside amcostestimate(). As I get, indexPages is used to
estimate how effective parallel scan would be, because different
workers pick different leaf pages. I'm going to adjust this sentence
and commit this fix.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

#3Alexander Korotkov
a.korotkov@postgrespro.ru
In reply to: Alexander Korotkov (#2)
Re: Doc patch for index access method function

On Fri, Aug 10, 2018 at 1:37 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:

On Fri, Aug 10, 2018 at 6:24 AM Tatsuro Yamada
<yamada.tatsuro@lab.ntt.co.jp> wrote:

Attached patch for fixing documents of "61.2. Index Access Method Functions" and
"61.6. Index Cost Estimation Functions".

I added a variable "double *indexPages" introduced by commit 5262f7a4f to the documents and
also added its explanation. Please read and revise it because I'm a non-native English speaker.

Good catch. It was overseen in 5262f7a4fc44, where parallel index
scan was introduced.

"This is used to adjust the estimate for the cost of the disk access."

This sentence doesn't look correct for me. Cost of the disk access is
estimated inside amcostestimate(). As I get, indexPages is used to
estimate how effective parallel scan would be, because different
workers pick different leaf pages. I'm going to adjust this sentence
and commit this fix.

Pushed.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

#4Tatsuro Yamada
yamada.tatsuro@lab.ntt.co.jp
In reply to: Alexander Korotkov (#3)
Re: Doc patch for index access method function

Hi Alexander,

On 2018/08/10 20:27, Alexander Korotkov wrote:

On Fri, Aug 10, 2018 at 1:37 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:

On Fri, Aug 10, 2018 at 6:24 AM Tatsuro Yamada
<yamada.tatsuro@lab.ntt.co.jp> wrote:

Attached patch for fixing documents of "61.2. Index Access Method Functions" and
"61.6. Index Cost Estimation Functions".

I added a variable "double *indexPages" introduced by commit 5262f7a4f to the documents and
also added its explanation. Please read and revise it because I'm a non-native English speaker.

Good catch. It was overseen in 5262f7a4fc44, where parallel index
scan was introduced.

"This is used to adjust the estimate for the cost of the disk access."

This sentence doesn't look correct for me. Cost of the disk access is
estimated inside amcostestimate(). As I get, indexPages is used to
estimate how effective parallel scan would be, because different
workers pick different leaf pages. I'm going to adjust this sentence
and commit this fix.

Pushed.

I agree the sentence you corrected.
Thanks for taking your time!

Tatsuro Yamada
NTT Open Source Software Center