Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Table Joins & Datatypes

Table Joins & Datatypes

From: <oracle_user_at_my-dejanews.com>
Date: Thu, 22 Oct 1998 20:06:23 GMT
Message-ID: <70o37v$j1d$1@nnrp1.dejanews.com>


Is there any major performance difference between 1) joining varchar2 columns from 2 tables.

         AND
2) joining number columns from 2 tables.

Eg:

Lets say we have
Situation 1:

TABLE1
Col1 varchar2(8) not null (also a primary key) Col2
Col3
.
.
.

TABLE2
Col1 Some data type (primary key)
Col2 varchar2(8) not null (foreign key) Col3
.
.
.

Situation 2:

TABLE1
Col1 number not null (also a primary key) Col2
Col3
.
.
.

TABLE2
Col1 Some data type (primary key)
Col2 number not null (foreign key)
Col3
.
.
.

THE QUERY: SELECT a.col3, b.col3,...
FROM table1 a,

       table2 b
WHERE a.col1 = b.col2;

The Question:

Will The Query work better for Situation1 or Situation2? Will there be a major performance difference? Does it make sense to make all the primary key's as an id fetched from a sequence?

thanks,
srikant

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Oct 22 1998 - 15:06:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US