Re: query planner weirdness?

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: query planner weirdness?
Дата
Msg-id
28468.1214665709@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
query planner weirdness? "Bob Duffey" <bobduffey68@gmail.com>
Re: query planner weirdness? Tom Lane <tgl@sss.pgh.pa.us>
Re: query planner weirdness? "Adam Rich" <adam.r@sbcglobal.net>
Re: query planner weirdness? Steve Atkins <steve@blighty.com>
Re: query planner weirdness? "Bob Duffey" <bobduffey68@gmail.com>
Re: query planner weirdness? Tom Lane <tgl@sss.pgh.pa.us>
Re: query planner weirdness? Steve Atkins <steve@blighty.com>
Re: query planner weirdness? "Bob Duffey" <bobduffey68@gmail.com>
"Bob Duffey"  writes:
> 2008/6/28 Steve Atkins :
>> If you're iterating through the records with a cursor, the plan may
>> be different, IIRC - weighted to provide first row quickly, as opposed
>> to the query that was run that's weighted to provide last row quickly.
>> 
> I agree, and I was hoping that would be the case, but as it happens it
> wasn't.

The planner does in fact pay more attention to first-row cost than total
cost when given a DECLARE CURSOR instead of a regular SELECT.
Apparently that wasn't enough to make the indexscan be preferred,
though, which is a bit curious.  You might want to look at
effective_cache_size as well as random_page_cost.

			regards, tom lane
В списке pgsql-general по дате отправления
От: hubert depesz lubaczewski
Дата:
От: Steve Atkins
Дата:
Сообщение: Re: query planner weirdness?
FAQ