Re: pgsql: Add better handling of redundant IS [NOT] NULL quals

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Add better handling of redundant IS [NOT] NULL quals
Дата
Msg-id 4071562.1706038734@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Add better handling of redundant IS [NOT] NULL quals  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2024-Jan-23, David Rowley wrote:
>> Until now PostgreSQL has not been very smart about optimizing away IS
>> NOT NULL base quals on columns defined as NOT NULL.

> Hmm, what happens if a NOT NULL constraint is dropped and you have such
> a plan in plancache?  As I recall, lack of a mechanism to invalidate
> such plans was the main reason for Postgres not to have this.

IIRC, we realized that that concern was bogus.  Removal of such
constraints would cause pg_attribute.attnotnull to change, leading
to a relcache invalidation on the table, forcing replan.  If anyone
tried to get rid of attnotnull or make it incompletely reliable,
then we'd have problems; but AFAIK that's not being contemplated.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Tristan Partin"
Дата:
Сообщение: Remove pthread_is_threaded_np() checks in postmaster
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Build versionless .so for Android