Page 1 of 1

which Data Type?

Posted: Sat Jul 08, 2006 1:20 am
by RiazAhmad
As in Sql server we try to keep data type of a primary key as integer bcoz its indexing is fast, so wut abt in oracle?
Bcoz mostly in oracle people try to use varchar2. is there no effect on indexing?

Posted: Tue Sep 19, 2006 7:00 am
by sudhakarpv5
Hi,

In Oracle, Numbers are stored in a packed decimal like format, which are character strings; Indexing on VARCHAR or NUMERIC would be the same effect.


Even in oracle we can create indexing on numeric data type also like
CREATE INDEX emp_indx ON emp(empno) COMPUTE STATISTICS;

Here the index is created on empno which will be numeric in type.
if it is varchar2 then the index can automatically allocate maximum space it has; if it is in numeric like integer it would take only fixed space for indexing .


HTH,
Sudhakar