Re: BUG #18205: Performance regression with NOT NULL checks. - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #18205: Performance regression with NOT NULL checks.
Date
Msg-id 20231119221744.qqb34x4fns3go3lb@awork3.anarazel.de
Whole thread Raw
In response to AW: BUG #18205: Performance regression with NOT NULL checks.  (Daniel Migowski <dmigowski@ikoffice.de>)
Responses Re: BUG #18205: Performance regression with NOT NULL checks.
AW: BUG #18205: Performance regression with NOT NULL checks.
List pgsql-bugs
Hi,

On 2023-11-19 21:15:37 +0000, Daniel Migowski wrote:
> Thank you for the detailed explanation. It surely has a reason to remove the
> previously used short-circuit in slot_getattr, at least in the special case
> when we

The short-circuit in slot_getattr() still exists, we just don't reach it in
this case.


> And yes, in my real world use case which I tried to understand I have a wide
> table with 81 columns, and I am using column 1,43,18,75 and filter by
> attribute 82,42, and 24.

Are most of the columns NULL or not?


> Don't know how to handle this, maybe I should rework the layout of all my
> tables and move the mostly used columns to the beginning.

It might also be worth to split the table into multiple tables and join when
necessary. Independent of this issue, relatively wide tuples, where you don't
use most of the columns, will cause unnecessary IO.

Greetings,

Andres



pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: BUG #18207: Turkiye LC Setting Error
Next
From: Andres Freund
Date:
Subject: Re: BUG #18205: Performance regression with NOT NULL checks.