Re: BUG #15984: order of where in() query affects query planer - Mailing list pgsql-bugs

From easteregg@verfriemelt.org
Subject Re: BUG #15984: order of where in() query affects query planer
Date
Msg-id 20190902092807.0e0770b0@mail.verfriemelt.org
Whole thread Raw
In response to Re: BUG #15984: order of where in() query affects query planer  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15987: Improve REINDEX of all indexes of a table at once
Next
From: PG Bug reporting form
Date:
Subject: BUG #15989: Cluster unable to open as hot standby after SIGKILL during exclusive backup