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 7B064D1C95A for ; Thu, 31 Jul 2003 20:58:30 +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 80397-06 for ; Thu, 31 Jul 2003 17:57:24 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8F745D1C956 for ; Thu, 31 Jul 2003 17:58:29 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6VKwBQ3019023; Thu, 31 Jul 2003 16:58:11 -0400 (EDT) To: Scott Cain Cc: pgsql-performance@postgresql.org Subject: Re: EXTERNAL storage and substring on long strings 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> Comments: In-reply-to Scott Cain message dated "31 Jul 2003 16:39:47 -0400" Date: Thu, 31 Jul 2003 16:58:11 -0400 Message-ID: <19022.1059685091@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/513 X-Sequence-Number: 2806 Scott Cain 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