| From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
|---|---|
| To: | Gabriel Weinberg <yegg(at)alum(dot)mit(dot)edu> |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: Sequential Scan Index Bug |
| Date: | 2004-04-07 05:37:42 |
| Message-ID: | 20040407053742.GB9824@wolff.to |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Sat, Apr 03, 2004 at 13:51:56 -0500,
Gabriel Weinberg <yegg(at)alum(dot)mit(dot)edu> wrote:
>
> I have a table with an integer column with about 10M rows in it.
>
> This column has an index (btree).
>
> When I try to select a row using this column with an integer, e.g. select *
> from table where id=4, it always uses the index. However, if I select try
> to select a row using this column with a decimal, e.g. select * from table
> where id=4.343, it skips the index entirely and does a sequential scan of
> the table.
>
> I am using v7.4.2 on Freebsd 4.9.
Depending on what you want to do, you probably either want to cast the
value to an int explicitly or combine that with a test (using a stable
function) to make sure the number is actually an integer.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PostgreSQL Bugs List | 2004-04-07 06:31:47 | BUG #1129: select query returns multiple results for a japanese characters |
| Previous Message | Jiang Wei | 2004-04-07 00:56:14 | INSERT INTO ... SELECT |