Re: track needed attributes in plan nodes for executor use

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: track needed attributes in plan nodes for executor use
Дата
Msg-id 612638.1752503352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: track needed attributes in plan nodes for executor use  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
Amit Langote <amitlangote09@gmail.com> writes:
> Not quite -- the optimization doesn’t require changes to the tuple
> header or representation. The existing deforming code already stops
> once all requested attributes are filled, using tts_nvalid to track
> that. What I’m proposing is to additionally allow the slot to skip
> ahead to the first needed attribute, rather than always starting
> deformation from attno 0. That lets us avoid alignment/null checks for
> preceding fixed-width attributes that are guaranteed to be unused.

I'm quite skeptical about this being a net win.  You could only skip
deformation for attributes that are both fixed-width and
guaranteed-not-null.  Having a lot of those at the start may be true
in our system catalogs (because we have other reasons to lay them out
that way) but I doubt it occurs often in user tables.  So I'm afraid
that this would eat more in planning time than it'd usually save in
practice.

I'm also bothered by the assumption that the planner has full
knowledge of which attributes will be used at run-time.  I don't
believe that the plan tree contains every Var reference that will
occur during execution.  Triggers, CHECK constraints, FK constraints,
etc are all things that aren't in the plan tree.

            regards, tom lane



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