public inbox for [email protected]
help / color / mirror / Atom feedFrom: Scott Ribe <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: checking for a NULL date in a partitioned table kills performance
Date: Fri, 23 Aug 2024 09:17:19 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <010001917f08731e-0052ded1-1c0a-4f39-a63f-3e99767c5f59-000000@email.amazonses.com>
References: <[email protected]>
<010001917f08731e-0052ded1-1c0a-4f39-a63f-3e99767c5f59-000000@email.amazonses.com>
> On Aug 23, 2024, at 5:39 AM, Doug Reynolds <[email protected]> wrote:
>
> You could try something really ugly where you make a function index that COALESCEs the nulls to 1-1-1900 and use the COALESCE in the query.
I don't see how that could be better than just creating a partial index on it WHERE contract_date IS NULL--and anyway I'm sure you're right that no index would help. No matter what, it seems that sequential scans of all partitions will be required since most rows have it null, and it's not even related to the partition key.
view thread (16+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: checking for a NULL date in a partitioned table kills performance
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox