Re: Index isn't used during a join.

От: Robert Creager
Тема: Re: Index isn't used during a join.
Дата: ,
Msg-id: 20060110081705.221792f9@thunder.logicalchaos.org
(см: обсуждение, исходный текст)
Ответ на: Re: Index isn't used during a join.  (Michael Fuhr)
Список: pgsql-performance

Скрыть дерево обсуждения

Index isn't used during a join.  (Robert Creager, )
 Re: Index isn't used during a join.  (Michael Fuhr, )
  Re: Index isn't used during a join.  (Robert Creager, )
  Re: Index isn't used during a join.  (Robert Creager, )
   Re: Index isn't used during a join.  (Michael Fuhr, )
    Re: Index isn't used during a join.  (Michael Fuhr, )
    Re: Index isn't used during a join.  (Robert Creager, )
     Re: Index isn't used during a join.  (Robert Creager, )
      Re: Index isn't used during a join.  (Michael Fuhr, )
     Re: Index isn't used during a join.  (Tom Lane, )
      Re: Index isn't used during a join.  (Robert Creager, )

When grilled further on (Mon, 9 Jan 2006 22:58:18 -0700),
Michael Fuhr <> confessed:

> On Mon, Jan 09, 2006 at 09:23:38PM -0700, Robert Creager wrote:
> > I'm working with a query to get more info out with a join.  The base
> > query works great speed wise because of index usage.  When the join is
> > tossed in, the index is no longer used, so the query performance tanks.
>
> The first query you posted returns 285 rows and the second returns
> over one million; index usage aside, that difference surely accounts
> for a performance penalty.  And as is often pointed out, index scans
> aren't always faster than sequential scans: the more of a table a
> query has to fetch, the more likely a sequential scan will be faster.

Thanks for pointing out the obvious that I missed.  Too much data in the second query.  It's supposed to match (row
wise)what was returned from the first query. 

Just ignore me for now...

Thanks,
Rob

--
 08:15:24 up 3 days, 42 min,  9 users,  load average: 2.07, 2.20, 2.25
Linux 2.6.12-12-2 #4 SMP Tue Jan 3 19:56:19 MST 2006

Вложения

В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: NOT LIKE much faster than LIKE?
От: Simon Riggs
Дата:
Сообщение: Re: NOT LIKE much faster than LIKE?