Re: Bad query optimizer misestimation because of TOAST tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad query optimizer misestimation because of TOAST tables
Дата
Msg-id 188.1107366272@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bad query optimizer misestimation because of TOAST tables  (Markus Schaber <schabios@logi-track.com>)
Ответы Re: Bad query optimizer misestimation because of TOAST  (Markus Schaber <schabios@logi-track.com>)
Список pgsql-performance
Markus Schaber <schabios@logi-track.com> writes:
> IMHO, this tells the reason. The query planner has a table size of 3
> pages, which clearly is a case for a seqscan. But during the seqscan,
> the database has to fetch an additional amount of 8225 toast pages and
> 127 toast index pages, and rebuild the geometries contained therein.

I don't buy this analysis at all.  The toasted columns are not those in
the index (because we don't support out-of-line-toasted index entries),
so a WHERE clause that only touches indexed columns isn't going to need
to fetch anything from the toast table.  The only stuff it would fetch
is in rows that passed the WHERE and need to be returned to the client
--- and those costs are going to be the same either way.

I'm not entirely sure where the time is going, but I do not think you
have proven your theory about it.  I'd suggest building the backend
with -pg and getting some gprof evidence.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: High end server and storage for a PostgreSQL OLTP system
Следующее
От: William Yu
Дата:
Сообщение: Re: High end server and storage for a PostgreSQL OLTP system