X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 01F099DCB9E for ; Wed, 15 Feb 2006 18:06:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30207-07 for ; Wed, 15 Feb 2006 18:06:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from nelson.osl.com (216-21-133-120.ip.van.radiant.net [216.21.133.120]) by postgresql.org (Postfix) with ESMTP id CDF2C9DCACE for ; Wed, 15 Feb 2006 18:06:54 -0400 (AST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: Re: How to force PostgreSQL using an index Date: Wed, 15 Feb 2006 14:06:55 -0800 Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to force PostgreSQL using an index Thread-Index: AcYyewNHm+5vkbPFSwyIhZ3FW0zILAAAHAaw From: "Owen Jacobson" To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.104 required=5 tests=[AWL=0.104] X-Spam-Score: 0.104 X-Spam-Level: X-Archive-Number: 200602/187 X-Sequence-Number: 24197 SET SESSION enable_seqscan TO OFF could be interpreted as a strong hint = to the server that you want it to use indexes. It's not completely = mandatory (the server WILL still do a sequential scan if it has to) but = postgresql will strongly prefer index scans. You may also have some = luck twiddling the cpu_index_tuple_cost option. - Owen (Apologies for the Outlookism.) -----Original Message----- From: pgsql-sql-owner@postgresql.org = [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Daniel Caune Sent: Wednesday, February 15, 2006 1:59 PM To: pgsql-sql@postgresql.org Subject: [SQL] How to force PostgreSQL using an index Hi, =20 Is there a way to force PostgreSQL using an index for a SELECT = statement? I just want to confirm that the index PostgreSQL decides to = use is better than the index I supposed PostgreSQL would use (I already = analyze the table). =20 Regards, =20 -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418 =20