Re: [HACKERS] JIT compiling expressions/deform + inlining prototypev2.0

Поиск
Список
Период
Сортировка
От andres@anarazel.de (Andres Freund)
Тема Re: [HACKERS] JIT compiling expressions/deform + inlining prototypev2.0
Дата
Msg-id 20170905164137.qww4277syccjm65y@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: [HACKERS] JIT compiling expressions/deform + inlining prototypev2.0  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Список pgsql-hackers
On 2017-09-05 13:58:56 +0300, Konstantin Knizhnik wrote:
> 
> 
> On 04.09.2017 23:52, Andres Freund wrote:
> > 
> > Yea, I've changed that already, although it's currently added earlier,
> > because the alignment is needed before, to access the column correctly.
> > I've also made number of efficiency improvements, primarily to access
> > columns with an absolute offset if all preceding ones are fixed width
> > not null columns - that is quite noticeable performancewise.
> 
> Unfortunately, in most of real table columns are nullable.

I'm not sure I agree with that assertion, but:


> I wonder if we can perform some optimization in this case (assuming that in
> typical cases column either contains mostly non-null values, either mostly
> null values).

Even if all columns are NULLABLE, the JITed code is still a good chunk
faster (a significant part of that is the slot->tts_{nulls,values}
accesses). Alignment is still cheaper with constants, and often enough
the alignment can be avoided (consider e.g. a table full of nullable
ints - everything is guaranteed to be aligned, or columns after an
individual NOT NULL column is also guaranteed to be aligned). What
largely changes is that the 'offset' from the start of the tuple has to
be tracked.

Greetings,

Andres Freund



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] A note about debugging TAP failures
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] psql - add special variable to reflect the last query status