Re: EXTERNAL storage and substring on long strings - Mailing list pgsql-performance

From Joe Conway
Subject Re: EXTERNAL storage and substring on long strings
Date
Msg-id 3F298409.4030309@joeconway.com
Whole thread Raw
In response to Re: EXTERNAL storage and substring on long strings  (Scott Cain <cain@cshl.org>)
List pgsql-performance
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


pgsql-performance by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Odd explain estimate
Next
From: Tom Lane
Date:
Subject: Re: Odd performance results