Re: a JOIN on same table, but 'slided over'

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: a JOIN on same table, but 'slided over'
Дата
Msg-id 24551.1182879041@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: a JOIN on same table, but 'slided over'  ("news.gmane.org" <nis@superlativ.dk>)
Ответы Re: a JOIN on same table, but 'slided over'  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Список pgsql-general
"news.gmane.org" <nis@superlativ.dk> writes:
> Gurjeet Singh skrev:
>> Also note that this query is much cheaper that the 'distinct on' query
>> by more than two orders on magnitude ( 217.86 vs. 98040.67):

> No it isn't. The estimate is much lower, but the actual times are very
> close:

> [explain of distinct on]
>> Time: 5.003 ms

> [explain of correlated subquery]
>> Time: 4.125 ms

You're both confused: the planner estimate certainly should not be taken
as gospel, but the actual runtime of an EXPLAIN (not EXPLAIN ANALYZE)
only reflects planning effort.

EXPLAIN ANALYZE output would be a lot more suitable to settle the
question which one is faster.

            regards, tom lane

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: View Triggers
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: problem importing data with psql