Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1as1co-0006ee-BI for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2016 05:21:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1as1cn-0000rT-5f for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2016 05:21:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1as1bR-0007kb-ET for pgsql-hackers@postgresql.org; Mon, 18 Apr 2016 05:20:05 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1as1bO-0002wF-4m for pgsql-hackers@postgresql.org; Mon, 18 Apr 2016 05:20:05 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id u3I5JtTE030798; Mon, 18 Apr 2016 14:19:55 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 5AE9B5F623; Mon, 18 Apr 2016 14:19:55 +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 4A7DA5F611; Mon, 18 Apr 2016 14:19:55 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTP id 39C02400CB8; Mon, 18 Apr 2016 14:19:55 +0900 (JST) Subject: Re: Declarative partitioning References: <55D3093C.5010800@lab.ntt.co.jp> <5678ACBC.8050809@lab.ntt.co.jp> <5698CE6D.3070907@lab.ntt.co.jp> <56C55973.80309@lab.ntt.co.jp> <56CD6598.4090302@lab.ntt.co.jp> <56DE2D4B.1040001@lab.ntt.co.jp> <56DF74F0.7060404@lab.ntt.co.jp> <56F0AC96.2010303@lab.ntt.co.jp> <57106F9E.3000309@lab.ntt.co.jp> From: Amit Langote Message-ID: <57146E6F.4060503@lab.ntt.co.jp> Date: Mon, 18 Apr 2016 14:19:43 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Ashutosh Bapat Cc: Robert Haas , Alexander Korotkov , Amit Langote , Corey Huinker , Pg Hackers X-TM-AS-MML: disable X-Pg-Spam-Score: -3.6 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 2016/04/15 18:46, Ashutosh Bapat wrote: > > 3. PartitionKeyData contains KeyTypeCollInfo, whose contents can be > obtained by calling functions exprType, exprTypemod on partexprs. Why do we > need to store that information as a separate member? There was no KeyTypeCollInfo in early days of the patch and then I found myself doing a lot of: partexprs_item = list_head(key->partexprs); for (attr in key->partattrs) { if (attr->attnum != 0) { // simple column reference, get type from attr } else { // expression, get type using exprType, etc. partexprs_item = lnext(partexprs_item); } } That ended up being quite a few places (though I managed to reduce the number of places over time). So, I created this struct which is initialized when partition key is built (on first open of the partitioned table). Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers