On 1/30/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Pavan Deolasee" <[EMAIL PROTECTED]> writes:
> The stack usage for toast_insert_or_update() may run into several KBs
> the MaxHeapAttributeNumber is set to a very large value of 1600. The
> could anywhere between 28K to 48K depending on alignment and whether its
> 32-bit or a 64-bit machine.
So? The routine is not re-entrant so I don't see that the stack space
is a big problem. It's coded that way to avoid palloc/pfree cycles...
I always thought that it would be costlier to have a repeated stack
of many KBs than dynamically allocating a small percentage of that. But I
might be wrong.
In fact, a small test I ran showed that mallloc/free is more costly. So may
Btw, I noticed that the toast_insert_or_update() is re-entrant.
calls simple_heap_insert() which somewhere down the line calls
toast_insert_or_update() again. It looks a bit surprising, haven't look into