I just think that the hash partition will not speed up the Query, because we don't know the location of certain rows such as the range partition or the list partition. For example, transactions in 2000 with a range partition, we can query the "transaction2000" partition table faster than we can query the "transaction" table.
best regards
yudianto
On Wed, Sep 15, 2021 at 8:38 PM Sergei Kornilov <sk@zsrv.org> wrote:
We don't do just id % 3, we calculate some hash value from partition key (id) and route the tuple according this hash value. Such condition for your example:
select *, satisfies_hash_partition('myschema.customers'::regclass, 3, 0, id) as modulus3_remainder0_target_partition from myschema.cust0;