public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Robert Haas <[email protected]>
Cc: Peter Geoghegan <[email protected]>
Cc: ro b <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Self contradictory examining on rel's baserestrictinfo
Date: Tue, 26 Nov 2024 12:13:55 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmobukqP10A4fVjxwGaku94Hfi7ZoiX5j=mQApm=2UvTAfQ@mail.gmail.com>
References: <TYCPR01MB6093E2A06F3F8CF8DF17B5CE852E2@TYCPR01MB6093.jpnprd01.prod.outlook.com>
	<CA+TgmoZqiCwHbZczXXLjucfuHi=7EahSyzEj5yrqYKMQ0QOL9Q@mail.gmail.com>
	<CAH2-Wzk4Sga+c63MC45V0QX_ZchPa-pMjcTDswve9z7Kq=6gTw@mail.gmail.com>
	<[email protected]>
	<CA+TgmobukqP10A4fVjxwGaku94Hfi7ZoiX5j=mQApm=2UvTAfQ@mail.gmail.com>

Robert Haas <[email protected]> writes:
> On Mon, Nov 25, 2024 at 4:39 PM Tom Lane <[email protected]> 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...






view thread (5+ 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], [email protected], [email protected], [email protected]
  Subject: Re: Self contradictory examining on rel's baserestrictinfo
  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