Re: Date vs Timestamp without timezone Partition Key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Cedric Leong <cedricleong(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Date vs Timestamp without timezone Partition Key
Date: 2020-05-25 04:48:23
Message-ID: 12135.1590382103@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Cedric Leong <cedricleong(at)gmail(dot)com> writes:
> Just in case someone is interested enough to answer this. Does anyone know
> if the performance for a date column vs a timestamp column as a partition
> key is large?

I doubt it's even measurable, at least on 64-bit machines. You're
basically talking about 32-bit integer comparisons vs 64-bit integer
comparisons.

On a 32-bit machine it's possible that an index on a date column
will be physically smaller, so you could get some wins from reduced
I/O. But on (most?) 64-bit machines that difference goes away too,
because of alignment restrictions.

As always, YMMV; it never hurts to do your own testing.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2020-05-25 06:47:59 Re: Request to help on Query improvement suggestion.
Previous Message Cedric Leong 2020-05-25 03:50:05 Date vs Timestamp without timezone Partition Key