Re: Values list-of-targetlists patch for comments (was Re:

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org
Subject: Re: Values list-of-targetlists patch for comments (was Re:
Date: 2006-08-02 13:43:01
Message-ID: 15263.1154526181@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Joe Conway 2006-08-02 13:58:31 Re: Values list-of-targetlists patch for comments (was Re:
Previous Message Bruce Momjian 2006-08-02 13:30:29 Re: Values list-of-targetlists patch for comments (was Re:

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2006-08-02 13:46:09 ecpg test suite
Previous Message Bruce Momjian 2006-08-02 13:30:29 Re: Values list-of-targetlists patch for comments (was Re:

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2006-08-02 13:58:31 Re: Values list-of-targetlists patch for comments (was Re:
Previous Message Bruce Momjian 2006-08-02 13:30:29 Re: Values list-of-targetlists patch for comments (was Re: