[GENERAL] converting in() clause into a with prefix?

2015-10-16 Thread Benjamin Smith
I have a horribly-performing query similar to below, and I'd like to convert it to use a "WITH mytable as ( ... ) " without having to re-architect my code. For some reason, using a WITH prefix seems to generally work much faster than IN() sub clause even allowing identical results. (runs in

Re: [GENERAL] converting in() clause into a with prefix?

2015-10-16 Thread David G. Johnston
On Fri, Oct 16, 2015 at 2:18 PM, Benjamin Smith wrote: > I have a horribly-performing query similar to below, and I'd like to > convert > it to use a "WITH mytable as ( ... ) " without having to re-architect my > code. > For some reason, using a WITH prefix seems to

Re: [GENERAL] converting in() clause into a with prefix?

2015-10-16 Thread dinesh kumar
On Fri, Oct 16, 2015 at 11:18 AM, Benjamin Smith wrote: > I have a horribly-performing query similar to below, and I'd like to > convert > it to use a "WITH mytable as ( ... ) " without having to re-architect my > code. > For some reason, using a WITH prefix seems to

Re: [GENERAL] converting in() clause into a with prefix?

2015-10-16 Thread Jim Nasby
On 10/16/15 1:18 PM, Benjamin Smith wrote: I have a horribly-performing query similar to below, and I'd like to convert it to use a "WITH mytable as ( ... ) " without having to re-architect my code. For some reason, using a WITH prefix seems to generally work much faster than IN() sub clause