From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Lyn A Headley <laheadle(at)cs(dot)uchicago(dot)edu> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: take my index, please |
Date: | 2001-04-30 03:58:50 |
Message-ID: | 10085.988603130@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Lyn A Headley <laheadle(at)cs(dot)uchicago(dot)edu> writes:
> Table "allocation"
> Attribute | Type | Modifier
> ----------------+--------------------------+----------
> allocation_oid | bigint | not null
> webco=# explain select * from allocation where allocation_oid = 5;
> NOTICE: QUERY PLAN:
> Seq Scan on allocation (cost=0.00..2295.79 rows=1 width=104)
Try
select * from allocation where allocation_oid = 5::int8;
As you wrote it, it's a cross-datatype operator (int8 vs int4)
and the planner is not very smart about those at the moment.
You should probably also ask yourself whether you *really* need int8
for this column, at least for the next release or two that it's likely
to be before something is done about this problem.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | J. Patrick Lanigan | 2001-04-30 05:01:11 | Include and lib dirs under RH7? |
Previous Message | suhail sarwar | 2001-04-29 16:55:24 | Variables in SQL statements |