Re: Partition prune with stable Expr

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: Partition prune with stable Expr
Дата
Msg-id CAKU4AWoyY6-_KMEKKbm8Oi9DtZDf4wkxq31ouSZ9o79zOhRdGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Partition prune with stable Expr  (Thomas Kellerer <shammat@gmx.net>)
Список pgsql-hackers


On Mon, Sep 28, 2020 at 9:17 PM Thomas Kellerer <shammat@gmx.net> wrote:
Andy Fan schrieb am 28.09.2020 um 02:54:
> Well, that's very interesting.  Specific to my user case, 
> SELECT * FROM p WHERE pkey = to_date('2018-12-13', 'yyyy-mm-dd)';

Why use to_date() at all for a constant value?
Can't you use a standard ANSI date literal (date '2018-12-13')?


This is from lots of legacy code from Oracle and the real case is 
to_date('20181213', 'yyyymmdd'). 

Alternatively, you could use make_date(2018,12,13) which is marked as immutable.


Thanks, Nice to know make_date function. 

--
Best Regards
Andy Fan

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Planner making bad choice in alternative subplan decision
Следующее
От: David Rowley
Дата:
Сообщение: Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros