Re: Skip Orderby Execution for Materialized Views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Skip Orderby Execution for Materialized Views
Дата
Msg-id 1719350.1696172086@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Skip Orderby Execution for Materialized Views  (Zhang Mingli <zmlpostgres@gmail.com>)
Ответы Re: Skip Orderby Execution for Materialized Views  (Zhang Mingli <zmlpostgres@gmail.com>)
Список pgsql-hackers
Zhang Mingli <zmlpostgres@gmail.com> writes:
> When create  or refresh a Materialized View, if the view’s query has order by, we may sort and insert the sorted data
intoview. 

Indeed.

> And if it’s true, shall we skip the order by clause for Materialized View  when executing create/refresh statement?

No.  The intent of a materialized view is to execute the query
as presented.  If the user doesn't understand the consequences
of that, it's not our job to think we are smarter than they are.

I think this patch should be rejected.

BTW, I'm pretty certain that this patch breaks some valid cases
even if we take your point of view as correct.  For one example,
you can't just remove the sort clause if the query uses DISTINCT ON.

            regards, tom lane



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

Предыдущее
От: Zhang Mingli
Дата:
Сообщение: Skip Orderby Execution for Materialized Views
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Regression in COPY FROM caused by 9f8377f7a2