Re: [GENERAL] Problems with inequalities on numeric fields in 6.5

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Martin Weinberg <weinberg(at)osprey(dot)phast(dot)umass(dot)edu>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Problems with inequalities on numeric fields in 6.5
Date: 1999-07-07 08:07:00
Message-ID: 199907070807.EAA09613@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> lmc=> explain select count(*) from lmctot where j_m>'3.4' and j_m<'3.5';
> NOTICE: QUERY PLAN:
>
> Aggregate (cost=62349.97 rows=788100 width=4)
> -> Index Scan using j on lmctot (cost=62349.97 rows=788100 width=4)
>
>
Please try this:

lmc=> explain select count(*) from lmctot where j_m>3.4::float4 and
j_m<3.5::float4

Also, given your min/max, I am not sure why it thinks it is going to get
788,100 rows. How many rows in the table again?

Does (3.5-3.4)/(max-min) * #rows = 788k?

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christian Rudow 1999-07-07 08:38:45 Re: [GENERAL] Empty date field !
Previous Message Bruce Momjian 1999-07-07 07:44:22 Re: [GENERAL] inet and cidr type problems