Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 495609FB558 for ; Fri, 1 Jun 2007 13:49:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 31918-09 for ; Fri, 1 Jun 2007 13:48:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.235]) by postgresql.org (Postfix) with ESMTP id 1F6B49FB543 for ; Fri, 1 Jun 2007 13:48:57 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 25so565024wry for ; Fri, 01 Jun 2007 09:48:57 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mtFWBBZ9Dj1fGYq7fb+nnY6/7Z8THWlG3KmVKAmXmIPhKy2ruD4/6EvxwxgK1hg052vmVoxE/Jde6uSStvlrtV2ZnBy/+Bp+LoT1yoL4zA2ApR8TzDL46hh3tNAfG9m3HWi06cNhNmiugESIq/OWDM7pTpXIDDCE/VwZa5rGX+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=kahRR4/WjQTCwbyvyJWe7mta9xmUvssNqtjsQhGnTbGxvdvjEsuNABp11STwbK95ERiIqsvB/4JhCYGINngGK/QaAPKx9Pxn4FeTfuL6gvKUINRyn5t0kQZfUnU3d33jgal9HApleLWyJnfwMGEF+itpoz8Kbc+dUlWOnbAybYs= Received: by 10.78.120.6 with SMTP id s6mr1345352huc.1180716536162; Fri, 01 Jun 2007 09:48:56 -0700 (PDT) Received: by 10.78.172.17 with HTTP; Fri, 1 Jun 2007 09:48:56 -0700 (PDT) Message-ID: Date: Fri, 1 Jun 2007 17:48:56 +0100 From: "Tyler Durden" To: pgsql-performance@postgresql.org Subject: Seq Scan MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/1 X-Sequence-Number: 25034 Hi, I'm having some problems in performance in a simple select count(id) from.... I have 700 000 records in one table, and when I do: # explain select (id) from table_name; -[ RECORD 1 ]---------------------------------------------------------------- QUERY PLAN | Seq Scan on table_name (cost=0.00..8601.30 rows=266730 width=4) I had created an index for id(btree), but still shows "Seq Scan". What I'm doing wrong? Thanks, Tyler