Re: Partitioning performance: cache stringToNode() of pg_constraint.ccbin - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Partitioning performance: cache stringToNode() of pg_constraint.ccbin
Date
Msg-id 20130608013058.GE408429@tornado.leadboat.com
Whole thread Raw
In response to Partitioning performance: cache stringToNode() of pg_constraint.ccbin  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Fri, Jun 07, 2013 at 11:58:14AM +0530, Amit Kapila wrote:
> So the memory increase number's would like:
> 
> Example for 64-bit m/c
> In database, there are 100 tables, each having 2 constraints and 30 live
> connections
> 
> Size increase = no. of tables * size of (Node*) * number of constraints *
> no. of live sessions
>               = 100 * 8 * 2 * 30
>               = 46.8K

That's the increase when nothing consults the constraints.  Upon first use of
a particular constraint, one cache can easily grow by a few hundred bytes.

> So if such a memory increase seems reasonable, then I think it would be
> really beneficial for the load of data in inherited tables.

I agree that the memory usage is the main downside.  We already do similar
caching for index expressions and for rules, incidentally.  On that note, I
see that the patch does not make RelationDestroyRelation() correctly free the
newly-cached data.  Will fix.

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Last log line for log_temp_files is disassociated with query
Next
From: Tom Lane
Date:
Subject: Re: Last log line for log_temp_files is disassociated with query