Re: Why is the comparison between timestamp and date so much slower then between two dates - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Why is the comparison between timestamp and date so much slower then between two dates
Date
Msg-id nendqu$sq1$2@ger.gmane.org
Whole thread Raw
In response to Re: Why is the comparison between timestamp and date so much slower then between two dates  (Alban Hertroys <haramrae@gmail.com>)
Responses Re: Re: Why is the comparison between timestamp and date so much slower then between two dates
List pgsql-general
Alban Hertroys schrieb am 13.04.2016 um 16:39:
>>> So my question is: why is comparing a timestamp to a date so much slower?
>
> The reason that the other way around is so much more expensive is that
> the database needs to do that conversion twice for every row in the
> table. When down-converting now(), the DB only needs to do that once
> for all rows.

Why does it do that for each row? The value of now() won't
change while the statement is running, so this conversion could
be done once at the start of the statement.


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Why is the comparison between timestamp and date so much slower then between two dates
Next
From: Moreno Andreo
Date:
Subject: Re: Multimaster