Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5C8CB9FA474 for ; Tue, 3 Oct 2006 09:11:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13662-04 for ; Tue, 3 Oct 2006 09:11:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lynet.oppetid.no (oppetid.no [80.65.51.2]) by postgresql.org (Postfix) with ESMTP id 0ED989FA3D7 for ; Tue, 3 Oct 2006 09:11:11 -0300 (ADT) Received: by lynet.oppetid.no (Postfix, from userid 1019) id C4FD5119F9F; Tue, 3 Oct 2006 14:11:09 +0200 (CEST) Date: Tue, 3 Oct 2006 14:11:09 +0200 From: Tobias Brox To: Tobias Brox Cc: Arnaud Lesauvage , pgsql-performance@postgresql.org Subject: Re: Poor performance on very simple query ? Message-ID: <20061003121109.GD30211@oppetid.no> References: <45224896.7040708@freesurf.fr> <20061003121004.GC30211@oppetid.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061003121004.GC30211@oppetid.no> Organization: Group Nordicbet User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.185 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/34 X-Sequence-Number: 21163 [Tobias Brox - Tue at 02:10:04PM +0200] > Did you try "analyze" as well? It's weird it's using seq scan, since > you have a primary key it's supposed to have an index ... though 500 > rows is little. > > I just checked up our own production database, takes 0.08 ms to fetch a > row by ID from one of our tables containing 176k with rows. Oh, the gid is not primary key. I guess I should also apologize for adding noise here :-) Make an index here! :-)