X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 990E0D1C50B for ; Thu, 31 Jul 2003 21:06:32 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80766-05 for ; Thu, 31 Jul 2003 18:05:25 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 4C8F9D1C512 for ; Thu, 31 Jul 2003 18:06:30 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 19267; Thu, 31 Jul 2003 13:28:54 -0700 Message-ID: <3F298409.4030309@joeconway.com> Date: Thu, 31 Jul 2003 14:03:05 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Cain Cc: Tom Lane , pgsql-performance@postgresql.org Subject: Re: EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <18305.1059680697@sss.pgh.pa.us> <1059682839.5415.53.camel@localhost.localdomain> In-Reply-To: <1059682839.5415.53.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/515 X-Sequence-Number: 2808 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 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