> On 14 Apr 2016, at 15:12, Thomas Kellerer wrote:
>
> now() (and current_timestamp as well) are defined to return the
> same value throughout the entire transaction.
>
> So the optimizer _should_ be smart enough to do the conversion only
> once at the beginning of the
On 13 April 2016 at 15:45, Tom Lane wrote:
> Thomas Kellerer writes:
>> So my question is: why is comparing a timestamp to a date so much slower?
>
> The date has to be up-converted to a timestamptz (not timestamp).
> I think the expensive part of that is
Thomas Kellerer writes:
> So my question is: why is comparing a timestamp to a date so much slower?
The date has to be up-converted to a timestamptz (not timestamp).
I think the expensive part of that is determining what timezone
applies, in particular whether DST is active.
I came across something strange today.
Consider the following table:
CREATE TABLE price_history
(
product_id integer,
valid_from date,
valid_to date,
price integer
);
CREATE INDEX i1 ON price_history (product_id, valid_from, valid_to);
The table