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: Why is the comparison between timestamp and date so much slower then between two dates
Date
Msg-id 20237.1460555122@sss.pgh.pa.us
Whole thread Raw
In response to 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
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 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.  You could try it
with "localtimestamp" (no parens) instead of "now()" to see how
it performs with a non-tz timestamp.

            regards, tom lane


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Why is the comparison between timestamp and date so much slower then between two dates
Next
From: Edson Richter
Date:
Subject: Re: Fastest way to duplicate a quite large database