Re: vacuum locking

scott.marlowe <scott.marlowe@ihs.com>

From: "scott.marlowe" <scott.marlowe@ihs.com>
To: Rob Nagler <nagler@bivio.biz>
Cc: <pgsql-performance@postgresql.org>
Date: 2003-10-30T14:29:32Z
Lists: pgsql-performance
On Wed, 29 Oct 2003, Rob Nagler wrote:

> Greg Stark writes:
> > > > SELECT a, (SELECT name FROM t2 WHERE t2.f2 = t1.f2)
> > > >   FROM t1
> > > >  GROUP BY f2 
> > > 
> > > This doesn't solve the problem.  It's the GROUP BY that is doing the
> > > wrong thing.  It's grouping, then aggregating.
> > 
> > But at least in the form above it will consider using an index on f2, and it
> > will consider using indexes on t1 and t2 to do the join.
> 
> There are 20 rows in t2, so an index actually slows down the join.
> I had to drop the index on t1.f2, because it was trying to use it
> instead of simply sorting 20 rows.

t2 was 'vacuum full'ed and analyzed, right?  Just guessing.