pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Declarative partitioning
Date: Mon, 18 Apr 2016 14:19:43 +0900
Message-ID: <57146E6F.4060503@lab.ntt.co.jp> (raw)
In-Reply-To: <CAFjFpRdLbhUD7N0GY+DcAez_yPetnVZ_rtwfQL1KoiZVpZ_06g@mail.gmail.com>
References: <55D3093C.5010800@lab.ntt.co.jp>
	<5678ACBC.8050809@lab.ntt.co.jp>
	<5698CE6D.3070907@lab.ntt.co.jp>
	<CA+TgmoY9C_XxbngCd9TtbEuwhu+4oHjeHt+QSzs-6bM=oY4f-w@mail.gmail.com>
	<56C55973.80309@lab.ntt.co.jp>
	<CADkLM=fz4SRiaLggFctOcJegpcjxaWPwCyi6YDwq9Wnceno7=w@mail.gmail.com>
	<56CD6598.4090302@lab.ntt.co.jp>
	<CADkLM=f1zyL-cV_LK8GpXv=iS_=VbHs8bernUMa+8yHtUXjebQ@mail.gmail.com>
	<56DE2D4B.1040001@lab.ntt.co.jp>
	<CADkLM=cb7q4TSYQYX4EsMHVK0hjEnBJiA8+XMSSropk2CHwa_A@mail.gmail.com>
	<56DF74F0.7060404@lab.ntt.co.jp>
	<CAPpHfdut34uqoY1vKgvBhsGZqhR6Nky=_Dxn0un57G_M2CvLTA@mail.gmail.com>
	<CA+HiwqFFH10_ku6z_Ps=H7=pR5cWJk9Bdr9nE08+3F53yTEr9A@mail.gmail.com>
	<CAPpHfdu0mGbt9T2Jx04OKJfJQ0zW55BFqmisinRYWd2OaowRWQ@mail.gmail.com>
	<CA+TgmoaoZRqk2dr3xonta3o4omKuO4V4niVC2DKKo9VpdMc_zQ@mail.gmail.com>
	<56F0AC96.2010303@lab.ntt.co.jp>
	<CAFjFpReZ2nmpfOA2uGdgVp3ivWC13VDFYOQ7rs5LFeqo_Zm4vA@mail.gmail.com>
	<57106F9E.3000309@lab.ntt.co.jp>
	<CAFjFpRdLbhUD7N0GY+DcAez_yPetnVZ_rtwfQL1KoiZVpZ_06g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


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



view thread (161+ messages)  latest in thread

Message-ID: <57146E6F.4060503@lab.ntt.co.jp>
Permalink:  ../57146E6F.4060503@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/57146E6F.4060503@lab.ntt.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: Langote_Amit_f8@lab.ntt.co.jp, ashutosh.bapat@enterprisedb.com, robertmhaas@gmail.com, a.korotkov@postgrespro.ru, amitlangote09@gmail.com, corey.huinker@gmail.com
  Subject: Re: Declarative partitioning
  In-Reply-To: <57146E6F.4060503@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox