X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EA98BDADE4 for ; Tue, 25 Oct 2005 12:04:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80514-06 for ; Tue, 25 Oct 2005 15:04:23 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.195]) by svr1.postgresql.org (Postfix) with ESMTP id B9CC5DAE03 for ; Tue, 25 Oct 2005 12:04:22 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id x7so258672nzc for ; Tue, 25 Oct 2005 08:04:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=WhWHBa1CI9Y11VnF1FPqBCLd7PzrBesu8tZ1n0i7bvfMR4fYQ9z3TyO7VLoBJIzijBF2cJJ/NPuLPqMdfckH5h7QpmXN84LgYK9O7g7LSP5GT5ti2WNoM5NtohMUHBCfsW3vo2AKepXrBXd7ySN+D92O0TjlnCXLR9aSEmUUmQM= Received: by 10.36.74.8 with SMTP id w8mr4961503nza; Tue, 25 Oct 2005 08:04:21 -0700 (PDT) Received: by 10.36.61.1 with HTTP; Tue, 25 Oct 2005 08:04:21 -0700 (PDT) Message-ID: <42567e060510250804y3329c901l21770d887dfcde42@mail.gmail.com> Date: Tue, 25 Oct 2005 20:34:21 +0530 From: Kishore B To: pgsql-performance@postgresql.org Subject: Re: Why Index is not working on date columns. In-Reply-To: <13279.1130247515@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5365_1464850.1130252661870" References: <42567e060510250147j582ce648p3ceef8e4376975be@mail.gmail.com> <13279.1130247515@sss.pgh.pa.us> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.285 required=5 tests=[AWL=0.174, HTML_40_50=0.086, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200510/365 X-Sequence-Number: 15133 ------=_Part_5365_1464850.1130252661870 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Tom, Thank you for your response. > I surmise that you are testing on toy tables and extrapolating to what > will happen on larger tables. > These tables participating here contain more than 8 million records as of now, and on every day, 200K records, will add to them. Thank you, Kishore. On 10/25/05, Tom Lane wrote: > > Kishore B writes: > > Can you guys please take a look at the following query and let me know > why > > the index is not considered in the plan? > > "Considered" and "used" are two different things. > > The two examples you give have the same estimated cost (within two > decimal places) so the planner sees no particular reason to choose one > over the other. > > I surmise that you are testing on toy tables and extrapolating to what > will happen on larger tables. This is an unjustified assumption. > Create a realistic test data set, ANALYZE it, and then see if the > planner chooses indexes you like. > > regards, tom lane > ------=_Part_5365_1464850.1130252661870 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Tom,
 
Thank you for your response.
 
I surmise that you are testing o= n toy tables and extrapolating to what
will happen on larger tables.&nbs= p;
These tables participating here contain more than 8 million records as= of now, and on every day, 200K records, will add to them.
 
 
Thank you,
Kishore.

 


 
On 10/25/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Kishore B <kishorebh@gmail.com> writes:
>  = ;Can you guys please take a look at the following query and let me know why
> the index is not considered in the plan?

"Considered&q= uot; and "used" are two different things.

The two examples= you give have the same estimated cost (within two
decimal places) so th= e planner sees no particular reason to choose one
over the other.

I surmise that you are testing on toy tables and= extrapolating to what
will happen on larger tables.  This is = an unjustified assumption.
Create a realistic test data set, ANALYZE it,= and then see if the
planner chooses indexes you like.

     =             &nb= sp;     regards, tom lane

------=_Part_5365_1464850.1130252661870--