Re: An out-of-date comment in nodeIndexonlyscan.c
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Ashwin Agrawal <aagrawal@pivotal.io>,
Pg Hackers <pgsql-hackers@postgresql.org>, Heikki Linnakangas <hlinnaka@iki.fi>, Kevin Grittner <kgrittn@gmail.com>
Date: 2021-06-13T12:54:18Z
Lists: pgsql-hackers
On Mon, 14 Jun 2021 at 00:02, Thomas Munro <thomas.munro@gmail.com> wrote:
> Here's a highly experimental patch I came up with that seems to
> produce the right results in simple cases, without (yet) involving the
> planner.
+ /* Find all equality quals. */
+ for (int i = 0; i < n_scan_keys; ++i)
+ {
+ if (scan_keys[i].sk_strategy == BTEqualStrategyNumber)
+ attnos[nattnos++] = scan_keys[i].sk_attno;
+ }
+
+ /* Are all attributes covered? */
+ /* XXX is this check enough or do we need to work harder? */
+ qsort(attnos, nattnos, sizeof(AttrNumber), compare_int16);
+ nattnos = qunique(attnos, nattnos, sizeof(AttrNumber), compare_int16);
+ if (nattnos == index->rd_index->indnkeyatts)
I think a more optimal and nicer way of doing that would be setting
bits in a Bitmapset then checking bms_num_members is equal to
n_scan_keys.
David
Commits
-
Block ALTER INDEX/TABLE index_name ALTER COLUMN colname SET (options)
- fdd88571454e 15.0 cited
-
Fix misleading comment in nodeIndexonlyscan.c.
- 706cb9bf4f43 9.4.24 landed
- d7395cf608e7 9.5.19 landed
- 0908c5ecf083 9.6.15 landed
- 69da8c1e69ef 10.10 landed
- 6827e46cdf35 11.5 landed
- 74b7cc8c0213 12.0 landed
-
Eliminate xmin from hash tag for predicate locks on heap tuples.
- c01262a82484 9.4.0 cited
-
Fix serializable mode with index-only scans.
- cdf91edba9f9 9.3.0 cited