Re: indexes across joins not used for count

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: indexes across joins not used for count
Дата
Msg-id 1350757282.14401.11.camel@jdavis
обсуждение исходный текст
Ответ на indexes across joins not used for count  (Jeremy Wells <jemmyw@gmail.com>)
Ответы Re: indexes across joins not used for count  (Jeremy Wells <jemmyw@gmail.com>)
Список pgsql-novice
On Tue, 2012-10-16 at 16:08 +1300, Jeremy Wells wrote:
> I'm running a query to do a count with two joins in it. I've added
> indexes to the tables for the join columns, but the explain of the query
> doesn't seem to be using the indexes:

Can you post the output of EXPLAIN ANALYZE? Did you do an ANALYZE of the
tables already?

You can often force an index scan by doing:

   SET enable_seqscan=false;

So also try setting that, and run EXPLAIN ANALYZE again, and see if it
uses the indexes, and if so, if it's faster.

Regards,
    Jeff Davis



В списке pgsql-novice по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Guidance needed to be a postgreSQL DBA
Следующее
От: Jeremy Wells
Дата:
Сообщение: Re: indexes across joins not used for count