Oracle NUMBER(10, 0) vs MySQL INTEGER as primary key column
811242Mar 24 2011 — edited Mar 31 2011Hello,
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!