Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle NUMBER(10, 0) vs MySQL INTEGER as primary key column

811242Mar 24 2011 — edited Mar 31 2011
Hello,

Recently I have migrated a database from MySQL to Oracle (XE) and there is a table that has an integer primary key. In MySQL I use Integer for that column, and in Oracle I use Number(10, 0).

As a primary key the column is automatically indexed; however when I perform this query (a short illustrating example, the actual query condition is much longer):

SELECT n.nr,n.x,n.y,n.z FROM data0points n WHERE((n.nr>1400 AND n.nr<1407) OR n.nr=1409 OR (n.nr>1410 AND n.nr<1416) OR (n.nr>1417 AND n.nr<1421) OR n.nr=1425 OR n.nr=1429...

(with nr being the primary key column)

it appears that Oracle is frequently about 100 times slower.

Is there any way to improve this?

Thank you!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2011
Added on Mar 24 2011
29 comments
2,792 views