Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id CF8969FB483 for ; Sat, 28 Jul 2007 19:30:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 72670-04 for ; Sat, 28 Jul 2007 19:30:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx3.ipf.is (dodge.ipf.is [85.197.192.152]) by postgresql.org (Postfix) with ESMTP id A59DF9FB400 for ; Sat, 28 Jul 2007 19:30:07 -0300 (ADT) Received: (qmail 25354 invoked by uid 1010); 28 Jul 2007 22:29:46 +0000 Received: from 88.149.106.19 by dodge (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 0.270217 secs); 28 Jul 2007 22:29:46 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via dodge X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 0.270217 secs Process 25347) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx3.ipf.is with SMTP; 28 Jul 2007 22:29:46 +0000 Subject: Re: RES: select on 1milion register = 6s From: Ragnar To: Bruno Rodrigues Siqueira Cc: pgsql-performance@postgresql.org In-Reply-To: <002001c7d153$944f3c60$e900a8c0@brunolaptop> References: <002001c7d153$944f3c60$e900a8c0@brunolaptop> Content-Type: text/plain Date: Sat, 28 Jul 2007 22:36:16 +0000 Message-Id: <1185662176.5778.314.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/406 X-Sequence-Number: 26090 On lau, 2007-07-28 at 17:12 -0300, Bruno Rodrigues Siqueira wrote: > where > > to_char( data_encerramento ,'yyyy-mm') > between '2006-12' and '2007-01' assuming data_encerramento is a date column, try: WHERE data_encerramento between '2006-12-01' and '2007-01-31' gnari