Re: Maintain the pathkesy for subquery from outer side information

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: Maintain the pathkesy for subquery from outer side information
Дата
Msg-id CAKU4AWo6-=9mg3UQ5UJhGCMw6wyTPyPGgV5oh6dFvwEN=+hb_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Maintain the pathkesy for subquery from outer side information  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> I think that in cases where there's not a semantic hazard involved,
> we'd usually have pulled up the subquery so that this is all moot
> anyway.
>

I get your point with this statement. Things driven by this idea look
practical and lucky.  But for the UniqueKey stuff, we are not
that lucky.

SELECT pk FROM t;  -- Maintain the UniqueKey would be not necessary.

However

SELECT DISTINCT pk FROM (SELECT volatile_f(a), pk from t) WHERE ..;

Maintaining the UniqueKey in subquery is necessary since it is useful outside.

-- 
Best Regards
Andy Fan (https://www.aliyun.com/)



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Следующее
От: Andrey Borodin
Дата:
Сообщение: Re: Avoiding data loss with synchronous replication