Re: weird comments in Memoize nodes

2022-05-18 Thread David Rowley
On Tue, 17 May 2022 at 08:02, David Rowley  wrote:
> Yeah, must be a copy-pasto.  I'll fix it with the attached after beta1
> is tagged.

Pushed.

David




Re: weird comments in Memoize nodes

2022-05-16 Thread David Rowley
On Tue, 17 May 2022 at 04:21, Peter Eisentraut
 wrote:
>  Oid*collations; /* cache keys */

> Is this a mistake, or could this be clarified?

Yeah, must be a copy-pasto.  I'll fix it with the attached after beta1
is tagged.

David
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index e319e83bd8..0ea9a22dfb 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -824,8 +824,9 @@ typedef struct Memoize
int numKeys;/* size of the two 
arrays below */
 
Oid*hashOperators;  /* hash operators for each key 
*/
-   Oid*collations; /* cache keys */
-   List   *param_exprs;/* exprs containing parameters */
+   Oid*collations; /* collations for each key */
+   List   *param_exprs;/* cache keys in the form of exprs 
containing
+* parameters */
boolsinglerow;  /* true if the cache entry 
should be marked as
 * complete 
after we store the first tuple in
 * it. */


weird comments in Memoize nodes

2022-05-16 Thread Peter Eisentraut

Consider:

typedef struct Memoize
{
Planplan;

int numKeys;/* size of the two arrays below */

Oid*hashOperators;  /* hash operators for each key */
Oid*collations; /* cache keys */
List   *param_exprs;/* exprs containing parameters */
...

I think the comment "cache keys" is weird here.  Maybe it was copied from

typedef struct MemoizePath
{
Pathpath;
Path   *subpath;/* outerpath to cache tuples from */
List   *hash_operators; /* hash operators for each key */
List   *param_exprs;/* cache keys */
...

but it's attached to a different field there.

Is this a mistake, or could this be clarified?