Thread: indexing of INT8 ?

indexing of INT8 ?

From
hubert depesz lubaczewski
Date:
hi
i just checked a friends database and it seems that INT8 fields are not
indexable.
i mean:
he has a table with several fields. one of this fields is int8 with unique
index.
we have aproximately 100000 records in this table, database is vacuumed, but
the index doesn't seem to work when i do something like

explain select * from table where int8field = xxxx;

is it known bug of 7.1.2 or is something wrong with the database?

depesz

--
hubert depesz lubaczewski                          http://www.depesz.pl/
------------------------------------------------------------------------
... and the end of all our exploring  will be to arrive where we started
and know the place for the first time.                    -- T. S. Eliot

Re: indexing of INT8 ?

From
Stephan Szabo
Date:
On Wed, 1 Aug 2001, hubert depesz lubaczewski wrote:

> hi
> i just checked a friends database and it seems that INT8 fields are not
> indexable.
> i mean:
> he has a table with several fields. one of this fields is int8 with unique
> index.
> we have aproximately 100000 records in this table, database is vacuumed, but
> the index doesn't seem to work when i do something like
>
> explain select * from table where int8field = xxxx;
>
> is it known bug of 7.1.2 or is something wrong with the database?

Sort of the former.  You need to explicitly cast the xxxx to int8 in
order for the index to get used.


Re: indexing of INT8 ?

From
Einar Karttunen
Date:
On Wed, 1 Aug 2001, hubert depesz lubaczewski wrote:

> hi
> i just checked a friends database and it seems that INT8 fields are not
> indexable.
> i mean:
> he has a table with several fields. one of this fields is int8 with unique
> index.
> we have aproximately 100000 records in this table, database is vacuumed, but
> the index doesn't seem to work when i do something like
>
> explain select * from table where int8field = xxxx;
>
If the index exists the problem might be that 'xxxx' is not an int8 value.
Try select * from table where int8field = xxxx::int8;.

- Einar Karttunen