Re: Query only slow on first run

Поиск
Список
Период
Сортировка
От Dave Dutcher
Тема Re: Query only slow on first run
Дата
Msg-id 05e801c831d7$bea1bee0$8e00a8c0@tridecap.com
обсуждение исходный текст
Ответ на Re: Query only slow on first run  (tmp <skrald@amossen.dk>)
Ответы Re: Query only slow on first run
Список pgsql-performance
> -----Original Message-----
> From: tmp
> We have primarily two tables of interest here: questions
> (~100k rows) and posts (~400k rows). Each post refers to a
> question, but only the "posts" rows for which the
> corresponding "question.status = 1" are relevant. This
> reduces the number of relevant question rows to about 10k.

Earlier you said only a small subset of questions have a status of 1, so I
assumed you meant like 100 not 10k :)  According to the explain analyze
there are only 646 rows in posts which match your criteria, so it does seem
like scanning posts first might be the right thing to do.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: GiST indexing tuples
Следующее
От: Matthew
Дата:
Сообщение: Re: GiST indexing tuples