pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: pgsql-patches@postgreSQL.org
Subject: Re: Values list-of-targetlists patch for comments (was Re:
Date: Wed, 02 Aug 2006 09:43:01 -0400
Message-ID: <15263.1154526181@sss.pgh.pa.us> (raw)
In-Reply-To: <44D03D9F.80203@joeconway.com>
References: <44B69778.5050104@dunslane.net>
	<50461.84.63.113.55.1152832991.squirrel@pezone.net>
	<ECCAAC0A3182895D3D12B0E8@[172.26.14.247]>
	<44B7ADFC.90205@dunslane.net>
	<44D03D9F.80203@joeconway.com>

Joe Conway <mail@joeconway.com> writes:
> This patch retains the memory consumption savings but doesn't break any 
> regression tests...

I'm unconvinced that retail pfree's are the way to go.  I just did some
profiling of this test case:

	insert into foo values
	(0,0,0),
	(1,1,1),
	(2,2,2),
	(3,3,3),
	... one million rows ...
	(999997,999997,999997),
	(999998,999998,999998),
	(999999,999999,999999);

using CVS tip, and got these oprofile results:

samples  %        symbol name
39742    10.1656  base_yyparse
38338     9.8065  XLogInsert
28247     7.2253  AllocSetAlloc
20490     5.2411  expression_tree_walker
16822     4.3029  ExecInitExpr
16469     4.2126  base_yylex
14789     3.7829  PageAddItem
11174     2.8582  LWLockAcquire
11167     2.8564  LWLockRelease
9195      2.3520  RewriteQuery
9120      2.3328  AllocSetFree
7788      1.9921  ExecInitValuesScan
7596      1.9430  ExecEvalConst
7586      1.9404  lappend
6860      1.7547  ValuesNext
6261      1.6015  heap_fill_tuple
6141      1.5708  MemoryContextAllocZeroAligned
5619      1.4373  fix_expr_references_walker
5613      1.4357  transformExpressionList
5269      1.3478  heap_insert
5177      1.3242  contain_vars_of_level_walker
4601      1.1769  heap_form_tuple
4345      1.1114  ExecutorRun
4299      1.0996  hash_any
4201      1.0746  MemoryContextAlloc
4061      1.0388  check_stack_depth

It's slightly depressing that there's not more time being spent in
places we can easily tweak, but anyway the salient point to me is
that AllocSetFree is already chewing a nontrivial part of the runtime.

			regards, tom lane



view thread (61+ messages)  latest in thread

Message-ID: <15263.1154526181@sss.pgh.pa.us>
Permalink:  ../15263.1154526181@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15263.1154526181@sss.pgh.pa.us

 · 

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-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mail@joeconway.com, pgsql-patches@postgreSQL.org
  Subject: Re: Values list-of-targetlists patch for comments (was Re:
  In-Reply-To: <15263.1154526181@sss.pgh.pa.us>

* 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