weird comments in Memoize nodes

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-05-16T16:21:09Z
Lists: pgsql-hackers
Consider:

typedef struct Memoize
{
     Plan        plan;

     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
{
     Path        path;
     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?



Commits

  1. Fix incorrect comments for Memoize struct