X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 9A9B29250AF for ; Sat, 31 May 2003 12:27:56 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 96991-03 for ; Sat, 31 May 2003 12:27:46 -0400 (EDT) Received: from TheWorld.com (pcls1.std.com [199.172.62.103]) by developer.postgresql.org (Postfix) with ESMTP id BF1F592601D for ; Sat, 31 May 2003 12:27:45 -0400 (EDT) Received: from trouble (pool-151-203-197-57.bos.east.verizon.net [151.203.197.57]) by TheWorld.com (8.12.8p1/8.12.8) with SMTP id h4VGRhJ8011224 for ; Sat, 31 May 2003 12:27:43 -0400 From: "Brian Tarbox" To: Subject: why Sequencial Scan when selecting on primary key of table? Date: Sat, 31 May 2003 12:30:40 -0400 Message-ID: <004301c32791$f983c710$01000001@trouble> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20030531080716.20944.h004.c001.wm@mail.dilger.cc.criticalpath.net> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/297 X-Sequence-Number: 2076 I have a simple table with a dozen integer fields and a primary key. When I say "explain select * from Patient where Patient_primary_key = 100" I get sequential scan. I've just converted my application from MySQL and am seeing everything run about 3X slower. What do I have to do to get postgres to use indexes? Brian Tarbox