From: Tom Lane <tgl@sss.pgh.pa.us>
To: Голубева Яна <ishsha@yandex.ru>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Define hash partition for certain column values
Date: Mon, 11 Jan 2021 01:36:08 -0500
Message-ID: <820805.1610346968@sss.pgh.pa.us> (raw)
In-Reply-To: <2278581610342154@mail.yandex.ru>
References: <2278581610342154@mail.yandex.ru>
=?utf-8?B?0JPQvtC70YPQsdC10LLQsCDQr9C90LA=?= <ishsha@yandex.ru> writes:
> Hello, I've found in source code that there is a function satisfies_hash_partition(oid, modulus, remainder, column_values[]) which allows to check if the certain column value will be placed in the certain partition. I' d like to know if there is an opportunity not to check the certain partition but to define which partition will be the certain column value placed in.
If you want to control what goes where, use list partitioning (or,
perhaps, range partitioning). Hash is only suitable if you do not
care which partition any particular row goes to.
Personally, I think hash partitioning is mostly academic, precisely
because of that. If the partitioning doesn't line up with application
requirements, you give up too much of the benefit of using partitions.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ishsha@yandex.ru
Subject: Re: Define hash partition for certain column values
In-Reply-To: <820805.1610346968@sss.pgh.pa.us>
References: <2278581610342154@mail.yandex.ru> <820805.1610346968@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox