Re: Saving stack space in nbtree's _bt_first function - Mailing list pgsql-hackers

From Mircea Cadariu
Subject Re: Saving stack space in nbtree's _bt_first function
Date
Msg-id 9acfd314-dc1a-4860-bce2-0c967e608a56@gmail.com
Whole thread Raw
Responses Re: Saving stack space in nbtree's _bt_first function
List pgsql-hackers

Hi,

On 07/07/2025 01:22, Peter Geoghegan wrote:
However, there's no reason why "ScanKeyData
notnullkeys[INDEX_MAX_KEYS]" needs to be an array at all. In practice,
_bt_first will only need a single temp notnullkeys ScanKeyData, since
there can never be more than a single deduced NOT NULL constraint used
within our final insertion scan key.

As an experiment, I added an elog(WARNING,...) just above the main changed line in the patch, and then ran the tests (make installcheck). This resulted in lines logged next to some of the SELECT statements in the following files in src/test/regress/sql: 

  • create_index.sql
  • inherit.sql

I saw the log line only once per query, showing that at least for the scenarios in the tests, the claim checks out. I then tried a couple of modifications to those queries which generated the log line, but did not get it to log more than once. 


Kind regards,

Mircea Cadariu 

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Issues with hash and GiST LP_DEAD setting for kill_prior_tuple
Next
From: "Joel Jacobson"
Date:
Subject: Re: Optimize LISTEN/NOTIFY