X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8C2A03A4A18 for ; Fri, 19 Nov 2004 22:29:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30359-01 for ; Fri, 19 Nov 2004 22:29:09 +0000 (GMT) Received: from svr4.postgresql.org (unknown [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id ECFB83A4AF5 for ; Fri, 19 Nov 2004 20:45:56 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr4.postgresql.org (Postfix) with ESMTP id C05CB5AF7E5 for ; Fri, 19 Nov 2004 20:12:03 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iAJK9W54014527; Fri, 19 Nov 2004 15:09:32 -0500 (EST) To: Arshavir Grigorian Cc: pgsql-performance@postgresql.org Subject: Re: index use In-reply-to: <419E471F.6040006@m-cam.com> References: <419E471F.6040006@m-cam.com> Comments: In-reply-to Arshavir Grigorian message dated "Fri, 19 Nov 2004 14:18:55 -0500" Date: Fri, 19 Nov 2004 15:09:31 -0500 Message-ID: <14526.1100894971@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/309 X-Sequence-Number: 9263 Arshavir Grigorian writes: > I have a query that when run on similar tables in 2 different databases > either uses the index on the column (primary key) in the where clause or > does a full table scan. The structure of the tables is the same, except > that the table where the index does not get used has an extra million > rows (22mil vs 23mil). I'd say you initialized the second database in a non-C locale. The planner is clearly well aware that the seqscan is going to be expensive, so the explanation has to be that it does not have a usable index available. regards, tom lane