Re: MemoryContextSwitchTo during table scan? - Mailing list pgsql-performance

From Neil Conway
Subject Re: MemoryContextSwitchTo during table scan?
Date
Msg-id 430A5632.10701@samurai.com
Whole thread Raw
In response to MemoryContextSwitchTo during table scan?  ("Jignesh Shah" <jigneshk@hotmail.com>)
List 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

pgsql-performance by date:

Previous
From: "Jignesh Shah"
Date:
Subject: Re: MemoryContextSwitchTo during table scan?
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Looking for a large database for testing