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

From Tom Lane
Subject Re: Re: Why is the comparison between timestamp and date so much slower then between two dates
Date
Msg-id 21662.1460642273@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why is the comparison between timestamp and date so much slower then between two dates  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Why is the comparison between timestamp and date so much slower then between two dates
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> So the optimizer _should_ be smart enough to do the conversion only
> once at the beginning of the statement and then use that converted
> value during the execution of the statement without the need
> to re-evaluate it for each row.

It's not; especially not in your originally posted case where the
up-conversion happens on the variable not the pseudo-constant.

            regards, tom lane


pgsql-general by date:

Previous
From: Ritanjali M
Date:
Subject: Cross DB insert with returning id
Next
From: Thomas Kellerer
Date:
Subject: Re: Why is the comparison between timestamp and date so much slower then between two dates