Re: [POC] hash partitioning
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: amul sul <sulamul@gmail.com>
Cc: Robert Haas <robertmhaas@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-13T06:41:09Z
Lists: pgsql-hackers
On Fri, May 12, 2017 at 6:08 PM, amul sul <sulamul@gmail.com> wrote:
> Hi,
>
> Please find the following updated patches attached:
I have done some testing with the new patch, most of the cases worked
as per the expectation except below
I expect the planner to select only "Seq Scan on t1" whereas it's
scanning both the partitions?
create table t (a int, b varchar) partition by hash(a);
create table t1 partition of t for values with (modulus 8, remainder 0);
create table t2 partition of t for values with (modulus 8, remainder 1);
postgres=# explain select * from t where a=8;
QUERY PLAN
----------------------------------------------------------
Append (cost=0.00..51.75 rows=12 width=36)
-> Seq Scan on t1 (cost=0.00..25.88 rows=6 width=36)
Filter: (a = 8)
-> Seq Scan on t2 (cost=0.00..25.88 rows=6 width=36)
Filter: (a = 8)
(5 rows)
Some cosmetic comments.
-----------------------------------
+ RangeVar *rv = makeRangeVarFromNameList(castNode(List, nameEl->arg));
+
Useless Hunk.
/*
- * Build a CREATE SEQUENCE command to create the sequence object, and
- * add it to the list of things to be done before this CREATE/ALTER
- * TABLE.
+ * Build a CREATE SEQUENCE command to create the sequence object, and add
+ * it to the list of things to be done before this CREATE/ALTER TABLE.
*/
Seems like, in src/backend/parser/parse_utilcmd.c, you have changed
the existing code with
pgindent. I think it's not a good idea to mix pgindent changes with your patch.
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
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