Re: MemoryContextSwitchTo during table scan?

From: Neil Conway <neilc(at)samurai(dot)com>
To: Jignesh Shah <jigneshk(at)hotmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: MemoryContextSwitchTo during table scan?
Date: 2005-08-22 22:48:18
Message-ID: 430A5632.10701@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jignesh Shah wrote:
> Now the question is why there are so many calls to MemoryContextSwitchTo
> in a single SELECT query command? Can it be minimized?

I agree with Tom -- if profiling indicates that MemoryContextSwitchTo()
is the bottleneck, I would be suspicious that your profiling setup is
misconfigured. MemoryContextSwitchTo() is essentially a function call,
two pointer assignments, and a function return. Try rerunning the test
with current sources -- MemoryContextSwitchTo() is now inlined when
using GCC, which should just leave the assignments.

-Neil

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2005-08-23 00:43:35 Re: Looking for a large database for testing
Previous Message Jignesh Shah 2005-08-22 22:37:21 Re: MemoryContextSwitchTo during table scan?