Re: indices usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Panov <dmitry(at)tsu(dot)tula(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: indices usage
Date: 2001-12-20 15:27:06
Message-ID: 8576.1008862026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dmitry Panov <dmitry(at)tsu(dot)tula(dot)ru> writes:
> isp_leased=# explain select count(*) from traffic_stat where timestamp between timestamp('2001-12-18') and timestamp('2001-12-19');

> The question is why it doesn't make use of traffic_stat_idx2?

Try '2001-12-19'::timestamp, instead, or use CAST if you want to conform
to the standard. The function syntax is not considered a constant for
reasons I won't delve into here.

> I think cost estimation is wrong in this case.

Could easy be. Do you want to try it with 7.2 beta?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter E. Chen 2001-12-20 16:00:27
Previous Message Tom Lane 2001-12-20 15:01:31 Re: Operation eq with varchar