Re: Query planner: current_* vs. explicit date - Mailing list pgsql-sql

From Tom Lane
Subject Re: Query planner: current_* vs. explicit date
Date
Msg-id 29706.1067270734@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query planner: current_* vs. explicit date  (Chris Gamache <cgg007@yahoo.com>)
List 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 by date:

Previous
From: Christoph Haller
Date:
Subject: Re: extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax
Next
From: Sergei Levchenko
Date:
Subject: connectby