|
-
Originally posted by abhaysk
Wat i gave the example there is just to illustrate the fact that insert or update with varchar as Pk would take more time...
Abhay, no offence, but your example illustrates nothing whatsoever! You can't be serrious with your conclusion that the example you gave realy illustrates that updating varchar PK is slower than updating numeric PK! This would be simply too ridiculous. If I extrapolate from your childishly simpe example, what would you think of the following statement:
"As abhay's example shows, it is perfectly evident, that creating an empty table with varchar column as a primary key is about 300 times slower than creating the table with number column as a PK. Just a look at the following timings from abhay's example prooves this point:
SQL> create table test1 ( Emp_Name Varchar(8) primary key );
Table created.
Elapsed: 00:00:03.08
SQL> create table test2 ( Emp_Number Number(8) primary key );
Table created.
Elapsed: 00:00:00.01
QUED."
Would anyone seriously give any credibility to the above "proof"? Don't think so.
If you would want realy to prove your point, then you should at least produce a representative test case. And I totaly agree with slimdave when he says that "it would be a real challenge to find any difference in performance inserting into a table with a varchar2 pk compared to number" (because that's exactly what you were claiming in your first reply).
And BTW, your "logical" explanation why searching in character indexed column would be slower than searching in number indexed column only shows that you don't understand how oracle stores number datatype values in the database:
It does matter, if we think logically searching a character would result slower than seraching number. One Character will use 8 bits to be stored on harddisk and number would use 4 bits.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|