From: easteregg@verfriemelt.org
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15984: order of where in() query affects query planer
Date: Mon, 02 Sep 2019 11:28:07 +0200
Message-ID: <20190902092807.0e0770b0@mail.verfriemelt.org> (raw)
i have created another example for you, were i get consistent results after the analyse with the different plans:
create table test( a int, b int, c int );
insert into test
select random()*100, random()*10, random()*5 FROM generate_series(1,1000000);
create index "full" on test( a, c );
create index "partial" on test( a, c ) where ( a in ( 3,4,5,6,7,8,9,10 ) and b in ( 2,3 ) );
analyse test;
explain analyse select * from test where a in ( 3,4,5,6,7,8,9,10 ) and b in ( 2,3 );
explain analyse select * from test where a in ( 3,4,5,6,7,8,10,9 ) and b in ( 2,3 );
do i have wrong expections from theryplanner, that those are in fact two different paths to take? currently i work around this issue by sorting the elements for the in statements, but i think that must be the wrong path.
with kind regards, richard
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: easteregg@verfriemelt.org, tgl@sss.pgh.pa.us
Subject: Re: BUG #15984: order of where in() query affects query planer
In-Reply-To: <20190902092807.0e0770b0@mail.verfriemelt.org>
References: <20190902092807.0e0770b0@mail.verfriemelt.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox