Scott Cain wrote:
I am not against recompiling.  I am currently using an RPM version, but
I could probably recompile; the compilation is probably straight forward
(adding something like `--with_profiling` to ./configure), but how
straight forward is actually doing the profiling?  Is there a document
somewhere that lays it out?


Try: rpm --rebuild --define 'beta 1' postgresql-7.3.4-1PGDG.src.rpm

This will get you Postgres with --enable-cassert and --enable-debug, and it will leave the binaries unstripped. Install the new RPMs.

Then start up psql in one terminal, followed by gdb in another. Attach to the postgres backend pid and set a breakpoint at toast_fetch_datum_slice. Then continue the gdb session, and run your sql statement in the psql session. Something like:

session 1:
  psql mydatabase

session 2:
  ps -ef | grep postgres
  (note the pid on the postgres backend, *not* the psql session)
  gdb /usr/bin/postgres
  attach <pid-of-backend>
  break toast_fetch_datum_slice
  continue

session 1:
  select substring(residues from 1000000 for 20000) from feature where
  feature_id=1;

session 2:
  did we hit the breakpoint in toast_fetch_datum_slice?

HTH,

Joe


---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings

Reply via email to