Re: Partitioned Table Index Column Order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Partitioned Table Index Column Order
Дата
Msg-id 2549783.1624491556@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Partitioned Table Index Column Order  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-general
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2021-Jun-23, Rumpi Gravenstein wrote:
>> As a best practice is it better to create the primary key starting or
>> ending with the partition column?

> It is not relevant from the partitioning point of view.  Other factors
> can be used to decide the column order.

See in particular the hints in

https://www.postgresql.org/docs/current/indexes-multicolumn.html

The only thing that's different about partitioned situations is that
any particular child partition might have only a few values of the
partitioning column, which'd suggest putting it last if there are
no other relevant considerations.  However, if you need a particular
column order to match query requirements, that's certainly going
to be a more important consideration.

            regards, tom lane



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Is there something similar like flashback query from Oracle planned for PostgreSQL
Следующее
От: David Rowley
Дата:
Сообщение: Re: Partitioned Table Index Column Order