Re: Adding support for Row Compares to nbtree startikey optimization

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: Adding support for Row Compares to nbtree startikey optimization
Date: 2025-08-15 06:37:31
Message-ID: 175523985114.994.399192844268418577.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I tested the patch. Basically all of my test cases passed. Just a few small comments:

+ if (subkey->sk_attno > firstchangingattnum) /* >, not >= */
+ break;

Can we enhance the comment to something like ">, not >= because firstchangingattnum starting from 1".

+ /*
+ * Compare the last tuple's datum for this row compare member
+ * (unless we already know that lasttup must satisfy qual)
+ */
+ if (!lastsatisfied)
+ {

When subkey->sk_attno <= firstchangingattnum, if first is not satisfied, then last should not be satisfied either, so we can skip check last.

The new status of this patch is: Waiting on Author

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-08-15 06:37:44 Re: Compilation issues for HASH_STATISTICS and HASH_DEBUG options
Previous Message Kirill Reshke 2025-08-15 06:16:32 Re: Skipping schema changes in publication