Re: Date vs Timestamp without timezone Partition Key

Поиск
Список
Период
Сортировка
От Cedric Leong
Тема Re: Date vs Timestamp without timezone Partition Key
Дата
Msg-id CAD6i=X1RWpg1GR0-h-KO0n=WE6PKoWeUs-pytgX6sfZSczQ54w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Date vs Timestamp without timezone Partition Key  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Date vs Timestamp without timezone Partition Key  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-performance
Somewhat unrelated but note to anyone who wants to swap out partition keys. Don't create a clone of the table with the new partition key and insert data. It messes up the query planner massively and makes everything much slower.

On Mon, May 25, 2020 at 12:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Cedric Leong <cedricleong@gmail.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

В списке pgsql-performance по дате отправления:

Предыдущее
От: Imre Samu
Дата:
Сообщение: Re: When to use PARTITION BY HASH?
Следующее
От: David Rowley
Дата:
Сообщение: Re: Date vs Timestamp without timezone Partition Key