Re: [PATCHES] Avg performance for int8/numeric
Re: [PATCHES] Avg performance for int8/numeric
От:
"Luke Lonergan" <llonergan@greenplum.com>
Дата:
Mark, On 11/24/06 6:03 PM, "Mark Kirkwood" wrote: >> Luke Lonergan wrote: >>> So, if I understand this correctly, we're calling Alloc and >>> ContextAlloc 10 >>> times for every row being summed? > > I haven't (so profile as attached is ok)... > OK - so, without having looked at the source recently, the last time I profiled it within gdb it looked like the following is what happens in the executor agg path: temp heaptuple is allocated, page is pinned, tuple is copied into temp heaptuple, page is unpinned, temp heaptuple is processed in agg path This seems to fit the pattern we're seeing in your profile given that we've got 4 attributes in this relation except that we're seeing it happen twice. It seems like for each attribute a DATUM is alloc'ed, plus one more, and this is done twice -> 10 alloc calls for each row being summed. If this is the case, we can surely not alloc/free for every row and datum by reusing the space... - Luke