X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C4418D1B4FC for ; Wed, 17 Sep 2003 21:21:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 99772-07 for ; Wed, 17 Sep 2003 18:20:47 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id E8127D1B501 for ; Wed, 17 Sep 2003 18:20:44 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h8HLKlpr005978; Wed, 17 Sep 2003 17:20:47 -0400 (EDT) To: Rhaoni Chiu Pereira Cc: PostgreSQL ADMIN Subject: Re: How can I make PosgreSQL use an Index ? In-reply-to: <1063831482.3f68c7bab4b1a@sistemica.info> References: <1063831482.3f68c7bab4b1a@sistemica.info> Comments: In-reply-to Rhaoni Chiu Pereira message dated "Wed, 17 Sep 2003 17:44:42 -0300" Date: Wed, 17 Sep 2003 17:20:46 -0400 Message-ID: <5977.1063833646@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/298 X-Sequence-Number: 10386 Rhaoni Chiu Pereira writes: > When I run a explain analyze with this where clause: > ... gsames00.ano_mes = to_char(ftnfco00.data_emissao,'YYYYMM') AND ... > ... > -> Seq Scan on gsames00 (cost=100000000.00..100000006.72 rows=372 width=10) > (actual time=0.01..0.96 rows=372 loops=19923) > ... If you're not going to show us the whole query and the whole EXPLAIN output, you're going to get equally incomplete answers. I will say though that forcing an index instead of a seqscan on a 372-row table isn't likely to be a magic bullet. You probably need a better join plan. Please post fuller details on pgsql-performance. You might save some time by reading the posting tips first ... http://techdocs.postgresql.org/guides/SlowQueryPostingGuidelines regards, tom lane