Re: EXTERNAL storage and substring on long strings

From: Joe Conway <mail(at)joeconway(dot)com>
To: Scott Cain <cain(at)cshl(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: EXTERNAL storage and substring on long strings
Date: 2003-07-31 21:03:05
Message-ID: 3F298409.4030309@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-07-31 21:10:22 Re: Odd performance results
Previous Message Andrew Sullivan 2003-07-31 20:59:21 Re: Odd explain estimate

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Cain 2003-07-31 21:11:15 Re: EXTERNAL storage and substring on long strings
Previous Message Tom Lane 2003-07-31 20:58:11 Re: EXTERNAL storage and substring on long strings