Re: [PERFORM] Planner sometimes doesn't use a relevant index with IN (subquery) condition

2012-11-13 Thread Gavin Flower
On 12/11/12 22:06, Rafał Rzepecki wrote: This indeed works around the issue. Thanks! On Mon, Nov 12, 2012 at 9:53 AM, ashutosh durugkar wrote: Hey Rafal, SELECT * FROM (SELECT run_id, utilization FROM stats) AS s WHERE run_id IN (SELECT run_id FROM runs WHERE server_id = 515); could you t

Re: [PERFORM] Planner sometimes doesn't use a relevant index with IN (subquery) condition

2012-11-12 Thread Rafał Rzepecki
This indeed works around the issue. Thanks! On Mon, Nov 12, 2012 at 9:53 AM, ashutosh durugkar wrote: > Hey Rafal, > > >>SELECT * FROM (SELECT run_id, utilization FROM stats) AS s WHERE > run_id IN (SELECT run_id FROM runs WHERE server_id = 515); > > could you try this: > > > SELECT * FROM (SELEC

[PERFORM] Planner sometimes doesn't use a relevant index with IN (subquery) condition

2012-11-11 Thread Rafał Rzepecki
[Please CC me on replies, as I'm not subscribed; thank you.] I've ran into a problem with the query planner and IN (subquery) conditions which I suspect to be a bug. I'll attempt to describe the relevant details of my database and explain which behaviour I find unexpected. I've also tried to trigg