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 931F63A4AFA for ; Fri, 19 Nov 2004 22:29:15 +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 29490-08 for ; Fri, 19 Nov 2004 22:29:11 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id F26BA3A4BBE for ; Fri, 19 Nov 2004 20:52:41 +0000 (GMT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 15A8C3559B; Fri, 19 Nov 2004 12:29:42 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 143813545E; Fri, 19 Nov 2004 12:29:42 -0800 (PST) Date: Fri, 19 Nov 2004 12:29:42 -0800 (PST) From: Stephan Szabo To: Arshavir Grigorian Cc: pgsql-performance@postgresql.org Subject: Re: index use In-Reply-To: <419E471F.6040006@m-cam.com> Message-ID: <20041119122810.X44886@megazone.bigpanda.com> References: <419E471F.6040006@m-cam.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/308 X-Sequence-Number: 9262 On Fri, 19 Nov 2004, Arshavir Grigorian wrote: > Hi, > > 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). > > The 2 boxes where these database run are very different (Sparc with scsi > disks and 2G RAM running Solaris 8 AND a PC with 128M RAM running and an > IDE drive running Linux RH9 2.4.20-20.9). I am not sure why that would > make a difference, but maybe it does. Is the second server running in "C" locale or a different locale? The optimization for LIKE to use indexes involves either making an index with a *_pattern_ops operator class or being in "C" locale.