X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3B3DA47611E for ; Tue, 4 Mar 2003 10:13:00 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 06483-10 for ; Tue, 4 Mar 2003 10:12:58 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 65BA2475DBD for ; Tue, 4 Mar 2003 10:12:58 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h24FD1x6023082; Tue, 4 Mar 2003 10:13:01 -0500 (EST) To: "Paul McKay" Cc: pgsql-performance@postgresql.org Subject: Re: Slow query performance on large table In-reply-to: <000001c2e25c$ad506170$0c64a8c0@paulspc> References: <000001c2e25c$ad506170$0c64a8c0@paulspc> Comments: In-reply-to "Paul McKay" message dated "Tue, 04 Mar 2003 14:45:18 +0000" Date: Tue, 04 Mar 2003 10:13:01 -0500 Message-ID: <23081.1046790781@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/7 X-Sequence-Number: 1305 "Paul McKay" writes: > The query I am executing is > Select time,value > From measurement > Where assessment = ? > And time between ? and ? EXPLAIN ANALYZE would help you investigate this. Is it using an indexscan? On which index? Does forcing use of the other index (by temporarily dropping the preferred one) improve matters? Possibly a two-column index on both assessment and time would be an improvement, but it's hard to guess without knowing anything about the selectivity of the two WHERE clauses. regards, tom lane