Re: Is partition pruning impacted by data type

From: Lok P <loknath(dot)73(at)gmail(dot)com>
To: sud <suds1434(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is partition pruning impacted by data type
Date: 2024-03-05 19:05:02
Message-ID: CAKna9VY_5=7mjukRocOM9NC7wUfF=dgE4qHSySF7ZEr_x33-Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Tue, Mar 5, 2024 at 1:09 AM sud <suds1434(at)gmail(dot)com> wrote:

>
> However the question we have is ,
> 1)If there is any downside of having the partition key with "timestamp
> with timezone" type? Will it impact the partition pruning of the queries
> anyway by appending any run time "time zone" conversion function during the
> query planning/execution phase?
> 2) As it will take the default server times , so during daylight saving
> the server time will change, so in that case, can it cause any unforeseen
> issue?
> 3)Will this cause the data to be spread unevenly across partitions and
> make the partitions unevenly sized? If will go for UTC/GMT as db time, the
> user's one day transaction might span across two daily partitions.
>
>
My 2 cents.
We have cases which use the "timestamp with timezone" column as partition
key and the partition pruning happens for the read queries without any
issue, so we don't see any conversion functions applied to the predicate as
such which is partition key. I think if the users go global it's better to
have the database time in UTC time zone. and it's obvious that, In case of
global users the data ought to be span across multiple days as the days
won't be as per the users time zone rather UTC.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sud 2024-03-05 19:29:41 Re: Is partition pruning impacted by data type
Previous Message Greg Sabino Mullane 2024-03-05 18:22:48 Re: When manual analyze is needed

Browse pgsql-performance by date

  From Date Subject
Next Message sud 2024-03-05 19:29:41 Re: Is partition pruning impacted by data type
Previous Message Greg Sabino Mullane 2024-03-05 17:04:17 Re: Optimizing count(), but Explain estimates wildly off