Re: Help speeding up this query - maybe need another index?

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: Help speeding up this query - maybe need another index?
Дата
Msg-id 448EAF2D.400@phlo.org
обсуждение исходный текст
Ответ на Help speeding up this query - maybe need another index?  ("Pat Maddox" <pergesu@gmail.com>)
Список pgsql-general
Pat Maddox wrote:
> Here's my SQL query.  I don't think it's too gigantic, but it is kind
> of beastly:
>
> SELECT COUNT(r) FROM trainer_hand_results r, trainer_scenarios s,
> trainer_scenario_stats stats WHERE r.user_id=1 AND
> r.trainer_scenario_id=s.id AND s.id=stats.trainer_scenario_id AND
> r.action=stats.correct_action;

The only indices that can help here are
trainer_hand_results: (user_id), (trainer_scenario_id)
trainer_scenarios: (id)
trainer_scenario_stats: (trainer_scenario_id), (correct_action)

Which of those help depends on the size of your tables.

greetings, Florian Pflug

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

Предыдущее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: pg_dump: missing pg_database entry
Следующее
От: "John Sidney-Woollett"
Дата:
Сообщение: Re: Searching BLOB