{SOLVED?] Re: [GENERAL] functional index not used, looping simpler query just faster

2008-07-10 Thread Ivan Sergio Borgonovo
On Thu, 10 Jul 2008 10:46:53 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > This sub-select is non optimizable because you've got an outer > reference in it, which compels re-evaluating it at every row of > the outer query. Try recasting as > explain select i1.brands, i1.name, i1.dataPub, i1.datains

Re: [GENERAL] functional index not used, looping simpler query just faster

2008-07-10 Thread Ivan Sergio Borgonovo
On Thu, 10 Jul 2008 10:46:53 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > Now I try this: > > > explain select i1.brands, i1.name, i1.dataPub, i1.datainserimento > > from catalog_items i1 > > inner join catalog_brands b1 on upper(i1.brands)

Re: [GENERAL] functional index not used, looping simpler query just faster

2008-07-10 Thread Tom Lane
Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > Now I try this: > explain select i1.brands, i1.name, i1.dataPub, i1.datainserimento > from catalog_items i1 > inner join catalog_brands b1 on upper(i1.brands)=upper(b1.name) > where i1.ItemID in ( > select i2.ItemID from catalog_items i2

Re: [GENERAL] functional index not used, looping simpler query just faster

2008-07-10 Thread Martijn van Oosterhout
On Thu, Jul 10, 2008 at 11:40:40AM +0200, Ivan Sergio Borgonovo wrote: > I've this: What's basically killing you is this condition: > select i2.ItemID from catalog_items i2 > inner join catalog_brands b2 on upper(i2.brands)=upper(b2.name) > where i1.brands=i2.brands <* > an