Re: [GENERAL] Using Variables in Queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Using Variables in Queries
Дата
Msg-id 11701.1508441749@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Using Variables in Queries  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, Oct 19, 2017 at 12:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> FROM  products,
>> (values ('red widget'::text)) consts(target)
>> WHERE similarity(target, item_name) > 0.25
>> ORDER BY target <<-> item_name
>> 
>> PG 9.5 and up will flatten out cases like this to be exactly what you
>> wrote out longhand.

> ​Does it matter if the values expression is embedded in a CTE?

Yes, CTEs are optimization fences ...
        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] Using Variables in Queries
Следующее
От: "Igal @ Lucee.org"
Дата:
Сообщение: Re: [GENERAL] Using Variables in Queries