Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans
Date
Msg-id 6dbf8f2c-b70e-9b4f-1ecb-504280659348@iki.fi
Whole thread Raw
In response to Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans
List pgsql-hackers
On 14/02/2023 11:10, Aleksander Alekseev wrote:
> Hi Andres,
> 
>> Shouldn't need to extract the column if we just want to know if it's NULL (see
>> heap_attisnull()). Afaics the value isn't accessed after this.
> 
> Many thanks. Fixed.

I'm confused, what exactly is the benefit of this? What extension 
performs a direct table scan bypassing the executor, searching for NULLs 
or not-NULLs?

If heapam can check for NULL/not-NULL more efficiently than the code 
that calls it, sure let's do this, and let's also see the performance 
test results to show the benefit. But then let's also modify the caller 
in nodeSeqScan.c to actually make use of it.

For tableam extensions, which may or may not support checking for NULLs, 
we need to add an 'amsearchnulls' field to the table AM API.

- Heikki




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: refactoring relation extension and BufferAlloc(), faster COPY
Next
From: Jim Jones
Date:
Subject: Re: [PATCH] Add pretty-printed XML output option