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 39603D1B500; Thu, 18 Sep 2003 17:51:07 +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 11045-09; Thu, 18 Sep 2003 14:50:37 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id B3657D1B509; Thu, 18 Sep 2003 14:50:35 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3653958; Thu, 18 Sep 2003 10:51:05 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Rhaoni Chiu Pereira Subject: Re: [PERFORM] How to force an Index ? Date: Thu, 18 Sep 2003 10:50:34 -0700 User-Agent: KMail/1.4.3 Cc: PostgreSQL ADMIN , PostgreSQL Performance References: <1063837067.3f68dd8b5a62b@sistemica.info> <200309171538.33515.josh@agliodbs.com> <1063896309.3f69c4f5cd16a@sistemica.info> In-Reply-To: <1063896309.3f69c4f5cd16a@sistemica.info> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309181050.34270.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/319 X-Sequence-Number: 10407 Rhaoni, > ... gsames00.ano_mes = to_char(ftnfco00.data_emissao,'YYYYMM') AND ... > Then it uses the gsames00 index instead of a SeqScan 'cuz it is > camparing same data type, but .. I don't want to create this function 'cuz > this aplication is used with Oracle too. You should have said that earlier .... > I need to know if there is a way to set the to_char output to varchar > instead of text ! Did you try: ... gsames00.ano_mes = (to_char(ftnfco00.data_emissao,'YYYYMM')::VARCHAR) AND ... -- Josh Berkus Aglio Database Solutions San Francisco