Re: [PERFORM] Index condition in a Nested Loop

2012-02-27 Thread Mark Hills
On Sun, 26 Feb 2012, Tom Lane wrote: > Mark Hills writes: > > What is that prevents the index condition from being used in earlier parts > > of the query? Only where a single condition is present is it be used below > > the final join. > > "WHERE job.jid IN

[PERFORM] Index condition in a Nested Loop

2012-02-26 Thread Mark Hills
I found in a production system that mostly the performance is being crippled by the handling of one particular case. I hope I've reduced this to a minimal example, below. Summary: when more than one key is given (or the data is sourced from a table) the planner is forced to a join of the whole

[PERFORM] Poor query plan across OR operator

2010-01-26 Thread Mark Hills
One of our most-used queries performs poorly (taking over 2 seconds) and a tiny amount of refactoring shows it can be fast (less than 1ms) by transforming the OR case (which spans two tables) into a UNION. I have created a simple test case (below) which shows the difference we are seeing in que