Re: strange explain - Mailing list pgsql-hackers

From Tom Lane
Subject Re: strange explain
Date
Msg-id 25474.1021383557@sss.pgh.pa.us
Whole thread Raw
In response to Re: strange explain  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
>> tour=# explain analyze  select * from tours  where
>> ( operator_id in (2,3,4,5,7) and type_id = 4 ) or
>> ( operator_id = 8 and type_id = 3);

> Actually this plan looks very strange to me. One would expect it to only use 
> type_idx twice (in lack of a better index (type_id, operator_id)). 
> Seems there is room for another performance improvement here :-)

Yeah, this demonstrates that reducing the quals to canonical form isn't
always the best thing to do.

Or maybe we could just look for duplicate indexqual conditions at the
end of the process?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Interval precision busted?
Next
From: Tom Lane
Date:
Subject: Re: Discontent with development process (was:Re: pgaccess - the discussion is over)