which Data Type?

In this forum Oracle Applications DBA's, System Administrators & Developers can share their knowledge/issues.
Post Reply
RiazAhmad
Posts: 7
Joined: Wed Apr 19, 2006 12:49 am
Location: Pakistan

which Data Type?

Post 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?
sudhakarpv5
Posts: 9
Joined: Tue Sep 19, 2006 5:16 am
Location: India

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests