Re: No access to TOAST tables shown in EXPLAIN ( ANALYZE, BUFFERS )

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: No access to TOAST tables shown in EXPLAIN ( ANALYZE, BUFFERS )
Дата
Msg-id 2586583.1643295137@sss.pgh.pa.us
обсуждение исходный текст
Ответ на No access to TOAST tables shown in EXPLAIN ( ANALYZE, BUFFERS )  (Christophe Courtois <christophe.courtois@dalibo.com>)
Список pgsql-bugs
Christophe Courtois <christophe.courtois@dalibo.com> writes:
> I've found that EXPLAIN (ANALYZE,BUFFERS) does not show any access to the TOAST tables when a toasted column is only
SELECTedand not used in any way in the query. 

This is probably because of the documented, long-standing behavior that
EXPLAIN does not convert the query's output rows to text, nor send them
to the client.  If the datatype output functions aren't called, the
output datums won't get detoasted either.

I don't see anything here we want to change.  The argument for not
bothering to model output costs has always been that they'd be the
same for every possible query plan, and I think that that applies to
detoasting costs as much as the actual output conversions.  Moreover,
if we're not sending data to the client, the skipped network I/O could
easily represent a larger cost than anything else --- but there's no
reasonable way to account for that.

If you do care about those costs, a possible answer is to run
auto_explain, allowing you to capture data behind-the-scenes for
queries that really are sending data to clients.

            regards, tom lane



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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: BUG #17375: RECOVERY TARGET TIME RESTORE IS FAILING TO START SERVER
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17384: ERROR: missing chunk number 0 for toast value 152073604 in pg_toast_2619