Update the comment in nodes.h to cover Cardinality

Started by Richard Guoabout 2 years ago3 messages
#1Richard Guo
guofenglinux@gmail.com
1 attachment(s)

By chance I discovered that the comment for the typedefs of "double"s
does not cover Cardinality. Should we update that comment accordingly,
maybe something like below?

- * Typedefs for identifying qualifier selectivities and plan costs as such.
- * These are just plain "double"s, but declaring a variable as Selectivity
- * or Cost makes the intent more obvious.
+ * Typedefs for identifying qualifier selectivities, plan costs and
+ * estimated rows or other count as such.  These are just plain "double"s,
+ * but declaring a variable as Selectivity, Cost or Cardinality makes the
+ * intent more obvious.

Thanks
Richard

Attachments:

v1-0001-Add-comment-for-Cardinality-typedef.patchapplication/octet-stream; name=v1-0001-Add-comment-for-Cardinality-typedef.patchDownload
From 7412fd52aa0eef0d07c721aac9b1d256603d069d Mon Sep 17 00:00:00 2001
From: Richard Guo <guofenglinux@gmail.com>
Date: Tue, 19 Dec 2023 14:14:41 +0800
Subject: [PATCH v1] Add comment for Cardinality typedef

---
 src/include/nodes/nodes.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index a178d08727..9ce3ecb5ab 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -251,9 +251,10 @@ extern bool equal(const void *a, const void *b);
 
 
 /*
- * Typedefs for identifying qualifier selectivities and plan costs as such.
- * These are just plain "double"s, but declaring a variable as Selectivity
- * or Cost makes the intent more obvious.
+ * Typedefs for identifying qualifier selectivities, plan costs and
+ * estimated rows or other count as such.  These are just plain "double"s,
+ * but declaring a variable as Selectivity, Cost or Cardinality makes the
+ * intent more obvious.
  *
  * These could have gone into plannodes.h or some such, but many files
  * depend on them...
-- 
2.31.0

#2Peter Eisentraut
peter@eisentraut.org
In reply to: Richard Guo (#1)
Re: Update the comment in nodes.h to cover Cardinality

On 19.12.23 07:23, Richard Guo wrote:

By chance I discovered that the comment for the typedefs of "double"s
does not cover Cardinality.  Should we update that comment accordingly,
maybe something like below?

- * Typedefs for identifying qualifier selectivities and plan costs as such.
- * These are just plain "double"s, but declaring a variable as Selectivity
- * or Cost makes the intent more obvious.
+ * Typedefs for identifying qualifier selectivities, plan costs and
+ * estimated rows or other count as such.  These are just plain "double"s,
+ * but declaring a variable as Selectivity, Cost or Cardinality makes the
+ * intent more obvious.

Fixed, thanks.

#3Richard Guo
guofenglinux@gmail.com
In reply to: Peter Eisentraut (#2)
Re: Update the comment in nodes.h to cover Cardinality

On Tue, Dec 19, 2023 at 10:50 PM Peter Eisentraut <peter@eisentraut.org>
wrote:

On 19.12.23 07:23, Richard Guo wrote:

By chance I discovered that the comment for the typedefs of "double"s
does not cover Cardinality. Should we update that comment accordingly,
maybe something like below?

- * Typedefs for identifying qualifier selectivities and plan costs as

such.

- * These are just plain "double"s, but declaring a variable as

Selectivity

- * or Cost makes the intent more obvious.
+ * Typedefs for identifying qualifier selectivities, plan costs and
+ * estimated rows or other count as such.  These are just plain

"double"s,

+ * but declaring a variable as Selectivity, Cost or Cardinality makes

the

+ * intent more obvious.

Fixed, thanks.

Thanks for the fix!

Thanks
Richard