Re: Re: Why is the comparison between timestamp and date so much slower then between two dates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Why is the comparison between timestamp and date so much slower then between two dates
Date: 2016-04-14 13:57:53
Message-ID: 21662.1460642273@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2016-04-14 14:10:16 Re: Why is the comparison between timestamp and date so much slower then between two dates
Previous Message Ritanjali M 2016-04-14 13:50:11 Cross DB insert with returning id