CaptainX0r <captainx0r@yahoo.com> writes:
> Well, I've got the Sun box now, but I don't really have acces to
> the G3. FWIW, top shows postgres slowly taking up all the CPU -
> over the course of a minute or so it gradually ramps up to
> around 90%. Once the query is complete, however, top shows the
> CPU ramping down slowly, ~1-2% per second over the next 2
> minutes which I find very strange.
I believe top's percent-of-CPU numbers for individual processes are time
averages over a minute or so, so the ramping effect is unsurprising.
> This doesn't really tell me much, except I'm guessing that PG is
> CPU bound?
Yup, that seems pretty clear. Next step is to find out what the heck
it's doing. My instinct would be to use gprof. Recompile with
profiling enabled --- if you're using gcc, this should work
cd postgres-distribution/src/backend
make clean
make PROFILE=-pg all
make install-bin -- may need to stop postmaster before install
Next run some sample queries (put them all into one session). After
quitting the session, find gmon.out in the $PGDATA/base/nnn/
subdirectory corresponding to your database, and feed it to gprof.
The results should show where the code hotspot is.
regards, tom lane