A rather hackish POC for alternative implementation of WITH TIES

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема A rather hackish POC for alternative implementation of WITH TIES
Дата
Msg-id 87o8wvz253.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответы Re: A rather hackish POC for alternative implementation of WITH TIES
Список pgsql-hackers
This patch is a rather hacky implementation of the basic idea for
implementing FETCH ... WITH TIES, and potentially also PERCENT, by using
a window function expression to compute a stopping point.

Large chunks of this (the parser/ruleutils changes, docs, tests) are
taken from Surafel Temesgen's patch. The difference is that the executor
change in my version is minimal: Limit allows a boolean column in the
input to signal the point at which to stop. The planner inserts a
WindowAgg node to compute the necessary condition using the rank()
function.

The way this is done in the planner isn't (IMO) the best and should
probably be improved; in particular it currently misses some possible
optimizations (most notably constant-folding of the offset+limit
subexpression). I also haven't tested it properly to see whether I broke
anything, though it does pass regression.

-- 
Andrew (irc:RhodiumToad)


Вложения

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

Предыдущее
От: "nagaura.ryohei@fujitsu.com"
Дата:
Сообщение: RE: [patch]socket_timeout in interfaces/libpq
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pgbench - add \aset to store results of a combined query