Re: Avoid computing ORDER BY junk columns unnecessarily

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Avoid computing ORDER BY junk columns unnecessarily
Дата
Msg-id CAMbWs49_r8dKUyjyNUw2KRX8hTxEWz0d8X=gjd=ezyUwoFtCng@mail.gmail.com
обсуждение исходный текст
Ответ на Avoid computing ORDER BY junk columns unnecessarily  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers

On Fri, Dec 22, 2023 at 2:38 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
v1-0004-Omit-columns-from-final-tlist-that-were-only-need.patch

The main patch in this series.

This patch filters out the junk columns created for ORDER BY/GROUP BY,
and retains the junk columns created for RowLocks.  I'm afraid this may
have a problem about out-of-order resnos.  For instance,

create table mytable (foo text, bar text);

# explain select foo from mytable order by bar for update of mytable;
server closed the connection unexpectedly

This query triggers another Assert in apply_tlist_labeling:

    Assert(dest_tle->resno == src_tle->resno);

At first there are three TargetEntry items: foo, bar and ctid, with
resnos being 1, 2 and 3.  And then the second item 'bar' is removed,
leaving only two items: foo and ctid, with resnos being 1 and 3.  So now
we have a missing resno, and finally hit the Assert.

Thanks
Richard

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Track in pg_replication_slots the reason why slots conflict?
Следующее
От: "Anton A. Melnikov"
Дата:
Сообщение: Re: Some performance degradation in REL_16 vs REL_15