public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andrei Lepikhov <[email protected]>
To: Andy Fan <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: a wrong index choose when statistics is out of date
Date: Mon, 4 Mar 2024 11:57:56 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On 3/3/2024 14:01, Andy Fan wrote:
> 1. We can let the user define the column as the value is increased day by
> day. the syntax may be:
>
> ALTER TABLE x_events ALTER COLUMN created_at ALWAYS_INCREASED.
>
> then when a query like 'create_at op const', the statistics module can
> treat it as 'created_at = $1'. so the missing statistics doesn't make
> difference. Then I think the above issue can be avoided.
Let me write some words to support your efforts in that way.
I also have some user cases where they periodically insert data in large
chunks. These chunks contain 'always increased' values, and it causes
trouble each time they start an analytic query over this new data before
the analyze command.
I have thought about that issue before but invented nothing special
except a more aggressive analysis of such tables.
Your trick can work, but it needs a new parameter in pg_type and a lot
of additional code for such a rare case.
I'm looking forward to the demo patch.
--
regards,
Andrei Lepikhov
Postgres Professional
view thread (2+ messages)
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: a wrong index choose when statistics is out of date
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