Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4SIjuA04076 for ; Mon, 28 May 2001 14:45:58 -0400 (EDT) (envelope-from martin@bugs.unl.edu.ar) Received: by bugs.unl.edu.ar (Postfix, from userid 1004) id 62A852AB39; Mon, 28 May 2001 15:46:21 +0300 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: =?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= To: Linh Luong , pgsql-sql@postgresql.org Subject: Re: Seq Scan Date: Mon, 28 May 2001 15:46:20 +0300 X-Mailer: KMail [version 1.2] References: <3B127BC9.683CD993@computalog.com> In-Reply-To: <3B127BC9.683CD993@computalog.com> MIME-Version: 1.0 Message-Id: <01052815462000.01658@bugs> Content-Transfer-Encoding: 8bit X-Archive-Number: 200105/303 X-Sequence-Number: 3144 On Lun 28 May 2001 19:24, Linh Luong wrote: > Hi, > > I am trying to execute this query I wrote and it is not returning at a > reasonable time to the browser. I took the query and ran EXPLAIN on it > and it displayed that every JOIN I do it is doing a Seq Scan on it. I > have indexes on that table but it doesn't seem to use it. > > Is there a way I can ensure that postgres will use my indexes? When Postgres doesnīt use indexes, itīs because sequencial scans are faster (I think the normal case would be a table with not so much rows). AFAIK, the planer is who does this, and it uses internal data which was gathered during a VACUUM analyze. So I would do a VACUUM analyze and the re-run the EXPLAIN to see what it shows. Saludos... :-) -- Cualquiera administra un NT. Ese es el problema, que cualquiera administre. ----------------------------------------------------------------- Martin Marques | mmarques@unl.edu.ar Programador, Administrador | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------