where clauses including timstamptz and intervals - Mailing list pgsql-general

From Niels Jespersen
Subject where clauses including timstamptz and intervals
Date
Msg-id df95450aee764d6fbedaf04613d17508@dst.dk
Whole thread Raw
Responses Re: where clauses including timstamptz and intervals
List pgsql-general
Hello all

Are these two queries exactly eqivalent? The table is partitioned on r_time, which is a timestamptz. The explain plans
arenot exactly the same. The first wants to scan a partition more than the latter.  

select f.xx from f
where f.r_time  >= '2020-10-01 00:00:00+00'::timestamptz
  and f.r_time < ('2020-10-01 00:00:00+00'::timestamptz + interval '1 month');

select f.xx from f
where f.r_time  >= '2020-10-01 00:00:00+00'::timestamptz
  and f.r_time < ('2020-11-01 00:00:00+00'::timestamptz);

Regards Niels Jespersen



pgsql-general by date:

Previous
From: Yi Sun
Date:
Subject: "index contains unexpected zero page" problem
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: where clauses including timstamptz and intervals