Re: Self contradictory examining on rel's baserestrictinfo

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, ro b <bigbro_wq(at)hotmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Self contradictory examining on rel's baserestrictinfo
Date: 2024-11-26 17:13:55
Message-ID: 1686217.1732641235@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Nov 25, 2024 at 4:39 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> ... I think Robert
>> must have had constraint_exclusion = on for his examples a
>> couple messages back.)

> I definitely didn't change the value of that setting. It's possible I
> was running on an older branch, but I don't think it was anything
> ancient.

Hmm, constraint_exclusion has defaulted to "partition" for many
years now. But when I tried to reproduce your examples at [1]:

regression=# create table foo (a int);
CREATE TABLE
regression=# explain select * from foo where a < 1 and a > 1;
QUERY PLAN
-----------------------------------------------------
Seq Scan on foo (cost=0.00..48.25 rows=13 width=4)
Filter: ((a < 1) AND (a > 1))
(2 rows)

regression=# show constraint_exclusion;
constraint_exclusion
----------------------
partition
(1 row)

regression=# set constraint_exclusion = on;
SET
regression=# explain select * from foo where a < 1 and a > 1;
QUERY PLAN
------------------------------------------
Result (cost=0.00..0.00 rows=0 width=0)
One-Time Filter: false
(2 rows)

and similarly for some of the other examples (I didn't try
every one). Maybe your test table was partitioned??

regards, tom lane

[1] https://www.postgresql.org/message-id/CA%2BTgmoZqiCwHbZczXXLjucfuHi%3D7EahSyzEj5yrqYKMQ0QOL9Q%40mail.gmail.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-11-26 17:15:45 Re: doc: pgevent.dll location
Previous Message Kirill Reshke 2024-11-26 17:11:02 Re: Allow non-superuser to cancel superuser tasks.