Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 706621337B4E for ; Tue, 10 May 2011 15:44:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 21341-07 for ; Tue, 10 May 2011 18:43:44 +0000 (UTC) X-Greylist: delayed 00:23:32.546873 by SQLgrey-1.7.6 Received: from ndmsnpf02.ndc.nasa.gov (ndmsnpf02.ndc.nasa.gov [198.117.0.122]) by mail.postgresql.org (Postfix) with ESMTP id E7E7E1337990 for ; Tue, 10 May 2011 15:43:43 -0300 (ADT) Received: from ndmsppt04.ndc.nasa.gov (ndmsppt04.ndc.nasa.gov [198.117.0.103]) by ndmsnpf02.ndc.nasa.gov (Postfix) with ESMTP id A9B287A0C2; Tue, 10 May 2011 13:20:10 -0500 (CDT) Received: from ndmshub01.ndc.nasa.gov (ndmshub01-pub.ndc.nasa.gov [198.117.0.160]) by ndmsppt04.ndc.nasa.gov (8.14.4/8.14.4) with ESMTP id p4AIKAVE026816; Tue, 10 May 2011 13:20:10 -0500 Received: from lrc000959195.larc.nasa.gov (198.119.134.170) by smtp02.ndc.nasa.gov (198.117.0.160) with Microsoft SMTP Server (TLS) id 8.3.137.0; Tue, 10 May 2011 13:20:10 -0500 Message-ID: <4DC981D9.3070008@nasa.gov> Date: Tue, 10 May 2011 14:20:09 -0400 From: "Maria L. Wilson" Reply-To: Organization: SSAI User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Robert Haas CC: "Wilson, Maria Louise (LARC-E301)[SCIENCE SYSTEMS AND APPLICATIONS, INC]" , "pgsql-performance@postgresql.org" Subject: Re: help speeding up a query in postgres 8.4.5 References: <4D9B6CBA.2050609@nasa.gov> <4DC97A40.7010905@nasa.gov> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2011-05-10_11:2011-05-10, 2011-05-10, 1970-01-01 signatures=0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/142 X-Sequence-Number: 43651 haven't tested a composite index invsensor is 2,003,980 rows and 219MB granver is 5,138,730 rows and 556MB the machine has 32G memory seq_page_cost, random_page_costs & effective_cache_size are set to the defaults (1,4, and 128MB) - looks like they could be bumped up. Got any recommendations? Maria On 5/10/11 1:59 PM, Robert Haas wrote: > [ woops, accidentally replied off-list, trying again ] > > On Tue, May 10, 2011 at 1:47 PM, Maria L. Wilson > wrote: >> thanks for taking a look at this.... and it's never too late!! >> >> I've tried bumping up work_mem and did not see any improvements - >> All the indexes do exist that you asked.... see below.... >> Any other ideas? >> >> CREATE INDEX invsnsr_idx1 >> ON invsensor >> USING btree >> (granule_id); >> >> CREATE INDEX invsnsr_idx2 >> ON invsensor >> USING btree >> (sensor_id); > What about a composite index on both columns? > >> CREATE UNIQUE INDEX granver_idx1 >> ON gran_ver >> USING btree >> (granule_id); > It's a bit surprising to me that this isn't getting used. How big are > these tables, and how much memory do you have, and what values are you > using for seq_page_cost/random_page_cost/effective_cache_size? > > ...Robert