Received: from belphigor.mcnaught.org ([216.151.155.121]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5CJ8jE29770 for ; Tue, 12 Jun 2001 15:08:45 -0400 (EDT) (envelope-from doug@wireboard.com) Received: (from doug@localhost) by belphigor.mcnaught.org (8.9.3/8.9.3) id PAA29716; Tue, 12 Jun 2001 15:08:38 -0400 X-Authentication-Warning: belphigor.mcnaught.org: doug set sender to doug@wireboard.com using -f To: Paul Tomblin Cc: pgsql-general@postgresql.org Subject: Re: Help me speed things up... References: <20010607010814.72573.qmail@web10005.mail.yahoo.com> <6630.991879552@sss.pgh.pa.us> <20010606222601.A7733@allhats.xcski.com> From: Doug McNaught Date: 12 Jun 2001 15:08:38 -0400 In-Reply-To: Paul Tomblin's message of "Wed, 6 Jun 2001 22:26:01 -0400" Message-ID: Lines: 24 User-Agent: Gnus/5.0806 (Gnus v5.8.6) XEmacs/21.1 (20 Minutes to Nikko) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200106/425 X-Sequence-Number: 10863 Paul Tomblin writes: > I'm doing some postgres stuff in perl. I haven't done much database stuff > in many years, and back then I was doing Oracle in C. I'm doing a major > query that gets a bunch of fields including a key, and then does other > queries with that key on other tables. Now with Oracle I would have set > up and compiled a query for the subqueries, and then only substituted in > the key variable and do the query, and repeat ad-nauseum. (Forgive the > fact that I've forgotten the terminology) There doesn't seem to be any > way to do that in Pg.pm, unless I'm missing something, and my subqueries > are making the whole thing slow as molasses. I think the query I just did > took about 45 minutes when I did the subqueries, and about 30 seconds > without. It's hard to say what might be going on, but I doubt that the query-compile overhead is hitting you that hard. Care to post a schema and EXPLAIN output for the queries you're doing?? -Doug (a former Monastery inmate..) -- The rain man gave me two cures; he said jump right in, The first was Texas medicine--the second was just railroad gin, And like a fool I mixed them, and it strangled up my mind, Now people just get uglier, and I got no sense of time... --Dylan