X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7583ED1E6C8 for ; Fri, 30 Apr 2004 15:29:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 99270-09 for ; Fri, 30 Apr 2004 15:29:12 -0300 (ADT) Received: from gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by svr1.postgresql.org (Postfix) with ESMTP id A13C5D1E796 for ; Fri, 30 Apr 2004 15:29:09 -0300 (ADT) Received: from gary (unverified [192.168.1.2]) by gpdnet.co.uk (SurgeMail 1.8g3) with ESMTP id 422 for ; Fri, 30 Apr 2004 19:28:39 +0100 From: "Gary Doades" To: pgsql-performance@postgresql.org Date: Fri, 30 Apr 2004 19:29:44 +0100 MIME-Version: 1.0 Subject: Re: planner/optimizer question Message-ID: <4092A928.27720.19838422@localhost> In-reply-to: <69EF9EF2-9AA2-11D8-A4E1-000D9366F0C4@torgo.978.org> References: <409207D6.17204.170D5A52@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Server: High Performance Mail Server - http://surgemail.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/527 X-Sequence-Number: 6827 On 30 Apr 2004 at 8:32, Jeff wrote: > > A better comparision query may be a simple "select a from mytable > where a between foo and bar" to get an index scan. In that case its a > straight up, vanilla index scan. Nothing else getting in the way. > Yes, you're right and I have done this just to prove to myself that it is the index scan that is the bottleneck. I have some complex SQL that executes very quickly with Postgres, similar to MSSQL, but the index scans in most of those only touch a few rows for a few loops. It seems to be a problem when the index scan is scanning very many rows and for each of these it has to go to the table just to find out if the index it just looked at is still valid. Gary.