Thread: indexes

indexes

From
"Chethana, Rao (IE10)"
Date:

Hello!

 

i tried creating indexes on columns that have datatype as bigint  or smallint , but  when I performed explain analyze,  the query was using sequential scan

 instead of index scanning.

 

Is it not possible to create indexes for attributes whose datatypes  r   bigint or smallint ?

 

Re: indexes

From
Martijn van Oosterhout
Date:
On Tue, Feb 28, 2006 at 07:56:14AM -0700, Chethana, Rao (IE10) wrote:
> Hello!
>
> i tried creating indexes on columns that have datatype as bigint  or
> smallint , but  when I performed explain analyze,  the query was using
> sequential scan
>
>  instead of index scanning.
>
> Is it not possible to create indexes for attributes whose datatypes  r
> bigint or smallint ?

On older versions of PostgreSQL you had to quote the integers to get it
to use an index scan. Recent versions don't have this problem anymore.
It could also have to do with the size of your table. However, since
you don't provide any useful details, I'm just speculating.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment