Re: BUG #19372: Scan operator maybe output unnecessary columns to the upper-layer operators

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #19372: Scan operator maybe output unnecessary columns to the upper-layer operators
Дата
Msg-id CAApHDvrDJ=bA0dTrcUs92Eg_gXO2DudjVJryiKLHR007L9SJhw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #19372: Scan operator maybe output unnecessary columns to the upper-layer operators  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Wed, 7 Jan 2026 at 23:39, 贾耀 <yaojia_0809@163.com> wrote:
I debugged the behavior of the statement using gdb, part of stack is:
#0 create_scan_plan
#1 create_plan_recurse
#2 create_projection_plan
#3 create_plan_recurse
#4 create_agg_plan
...
I think the point is flags in create_plan.
In frame 4, it give the flags CP_LABLE_TLIST; so use_physical_tlist of create_projection_plan return true in frame 2, and give the flags 0; so use_physical_tlist of create_scan_plan return true in frame 0, and build tlist with build_physical_tlist rather than build_path_tlist. build_physical_tlist will build all columns of table, build_path_tlist will build necessary columns with best_path's path target.

If I force it to go through build_path_tlist, I can get the simplified output of seqscan(just hjid and rjid)

So, it's a bug about flags? Will you fix it?

I've already mentioned, the current behaviour is intentional. So there are no changes to be made.

By all means, try your flag hack locally and see if performance is better or worse.

David

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