Re: Query planner: current_* vs. explicit date

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query planner: current_* vs. explicit date
Дата
Msg-id 29706.1067270734@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query planner: current_* vs. explicit date  (Chris Gamache <cgg007@yahoo.com>)
Список pgsql-sql
Chris Gamache <cgg007@yahoo.com> writes:
> By giving it a definitive range I was able to coax query planner to use the
> index:

> SELECT id FROM trans_table WHERE trans_date >=  (SELECT
> current_date::timestamptz) AND trans_date < (SELECT current_timestamp);

> BTW, This didn't work:

> SELECT id FROM trans_table WHERE trans_date >= current_date::timestamptz AND
> trans_date < current_timestamp;

[ scratches head... ]  AFAICS the latter should "work" too.  Doesn't
EXPLAIN show the same estimated row count for both versions?
        regards, tom lane


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

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax
Следующее
От: Sergei Levchenko
Дата:
Сообщение: connectby