Re: [POC] hash partitioning
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: amul sul <sulamul@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, Yugo Nagata <nagata@sraoss.co.jp>, David Steele <david@pgmasters.net>,
Greg Stark <stark@mit.edu>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-05-17T18:21:48Z
Lists: pgsql-hackers
On Wed, May 17, 2017 at 1:41 AM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote: >> Fixed in the attached version; used "hash partition remainder must be >> greater than or equal to 0" instead. > > I would suggest "non-zero positive", since that's what we are using in > the documentation. Well, that's not very good terminology, because zero is not a positive number. Existing error messages seem to use phrasing such as "THING must be a positive integer" when zero is not allowed or "THING must be a non-negative integer" when zero is allowed. For examples, do git grep errmsg.*positive or git grep errmsg.*negative. > In partition_bounds_equal(), please add comments explaining why is it safe to > check just the indexes? May be we should add code under assertion to make sure > that the datums are equal as well. The comment could be something > like, "If two partitioned tables have different greatest moduli, their > partition schemes don't match. If they have same greatest moduli, and > all remainders have different indexes, they all have same modulus > specified and the partitions are ordered by remainders, thus indexes > array will be an identity i.e. index[i] = i. If the partition > corresponding to a given remainder exists, it will have same index > entry for both partitioned tables or if it's missing it will be -1. > Thus if indexes array matches, corresponding datums array matches. If > there are multiple remainders corresponding to a given partition, > their partitions are ordered by the lowest of the remainders, thus if > indexes array matches, both of the tables have same indexes arrays, in > both the tables remainders corresponding to multiple partitions all > have same indexes and thus same modulus. Thus again if the indexes are > same, datums are same.". That seems quite long. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Refactor get_partition_for_tuple a bit.
- f0a0c17c1b12 11.0 landed
-
Adopt Bob Jenkins' improved hash function for hash_any(). This changes the
- 8205258fa675 8.4.0 cited
-
Improve hash_any() to use word-wide fetches when hashing suitably aligned
- 2604359251d3 8.4.0 cited