Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxT8F-0004fL-4A for pgsql-committers@arkaria.postgresql.org; Thu, 28 Sep 2017 07:21:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dxT8E-0004OB-JN for pgsql-committers@arkaria.postgresql.org; Thu, 28 Sep 2017 07:21:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dxT7y-0003Z4-Q4; Thu, 28 Sep 2017 07:20:58 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxT7v-0000UB-GR; Thu, 28 Sep 2017 07:20:57 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id v8S7Krak021816; Thu, 28 Sep 2017 16:20:53 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 57DA45F65A; Thu, 28 Sep 2017 16:20:53 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 41C445F612; Thu, 28 Sep 2017 16:20:53 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id E867E400D25; Thu, 28 Sep 2017 16:20:52 +0900 (JST) Subject: Re: [HACKERS] PartitionSchemaData & partcollation (Re: pgsql: Associate partitioning information with each RelOptInfo.) References: <571d159d-ca5e-ab0a-1bbf-2cef66ba0e42@lab.ntt.co.jp> From: Amit Langote Message-ID: <7cec02e2-91cf-40e0-7ed8-e3ba18f62a2c@lab.ntt.co.jp> Date: Thu, 28 Sep 2017 16:20:39 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit To: Ashutosh Bapat Cc: Robert Haas , pgsql-committers@postgresql.org, Pg Hackers X-TM-AS-MML: disable List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2017/09/28 16:13, Ashutosh Bapat wrote: > On Thu, Sep 28, 2017 at 11:47 AM, Amit Langote wrote: >> On 2017/09/21 12:42, Robert Haas wrote: >>> Associate partitioning information with each RelOptInfo. >>> >>> This is not used for anything yet, but it is necessary infrastructure >>> for partition-wise join and for partition pruning without constraint >>> exclusion. >>> >>> Ashutosh Bapat, reviewed by Amit Langote and with quite a few changes, >>> mostly cosmetic, by me. Additional review and testing of this patch >>> series by Antonin Houska, Amit Khandekar, Rafia Sabih, Rajkumar >>> Raghuwanshi, Thomas Munro, and Dilip Kumar. >> >> I noticed that this commit does not add partcollation field to >> PartitionSchemeData, while it adds parttypcoll. I think it'd be necessary >> to have partcollation too, because partitioning would have used the same, >> not parttypcoll. For, example see the following code in >> partition_rbound_datum_cmp: >> >> cmpval = DatumGetInt32(FunctionCall2Coll(&key->partsupfunc[i], >> key->partcollation[i], >> rb_datums[i], >> tuple_datums[i])); >> >> So, it would be wrong to use parttypcoll, if we are to use the collation >> to match a clause with the partition bounds when doing partition-pruning. >> Concretely, a clause's inputcollid should match partcollation for the >> corresponding column, not the column's parttypcoll. >> >> Attached is a patch that adds the same. I first thought of including it >> in the partition-pruning patch set [1], but thought we could independently >> fix this. >> > > I think PartitionSchemeData structure will grow as we need more > information about partition key for various things. E.g. partsupfunc > is not part of this structure right now, but it would be required to > compare partition bound datums. Similarly partcollation. Please add > this to partition pruning patchset. May be parttypcoll won't be used > at all and we may want to remove it altogether. Okay, I will post it with the partition-pruning patch set. Thanks, Amit -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers