pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Scott Cain <cain@cshl.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: EXTERNAL storage and substring on long strings
Date: Thu, 31 Jul 2003 16:58:11 -0400
Message-ID: <19022.1059685091@sss.pgh.pa.us> (raw)
In-Reply-To: <1059683986.1428.59.camel@localhost.localdomain>
References: <1059679600.1429.41.camel@localhost.localdomain>
	<18305.1059680697@sss.pgh.pa.us>
	<1059682839.5415.53.camel@localhost.localdomain>
	<18763.1059683520@sss.pgh.pa.us>
	<1059683986.1428.59.camel@localhost.localdomain>

Scott Cain <cain@cshl.org> writes:
> I see, encoding is a per database option.  Since I've never set it, all
> my databases use sql_ascii.

Okay, then you've dodged the obvious bullet; time to try profiling I
guess.  The way I usually do it is (given a clean, configured source
tree):

	cd src/backend
	gmake PROFILE="-pg -DLINUX_PROFILE" all
	install resulting postgres executable

(The -DLINUX_PROFILE is unnecessary on non-Linux machines, but AFAIK it
won't hurt anything either.)  Once you have this installed, each session
will end by dumping a gmon.out profile file into the $PGDATA/base/nnn
directory for its database.  After you've done a test run, you do

	gprof path/to/postgres/executable path/to/gmon.out >outputfile

and voila, you have a profile.

It's a good idea to make sure that you accumulate a fair amount of CPU
time in a test session, since the profile depends on statistical
sampling.  I like to have about a minute of accumulated runtime before
trusting the results.  Repeat the same query multiple times if needed.

			regards, tom lane



view thread (31+ messages)  latest in thread

Message-ID: <19022.1059685091@sss.pgh.pa.us>
Permalink:  ../19022.1059685091@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19022.1059685091@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cain@cshl.org, pgsql-performance@postgresql.org
  Subject: Re: EXTERNAL storage and substring on long strings
  In-Reply-To: <19022.1059685091@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox