Archive for May 20th, 2009
Oracle: matching SYS_GUID’s
Answering questions asked on the site.
Habib asks:
I have a table with a
PRIMARY KEY
defined asConsumerID RAW(16) NOT NULL
.However, when I issue a query like this:
SELECT * FROM Consumers WHERE ConsumerID = '1DFFC45DEDEB42B8B79B060D544C2ACB', it uses a
TABLE ACCESS FULL
and is very slow.How can I improve this query?
Defining a PRIMARY KEY
column as RAW(16)
almost always means using system generated GUID
's returned by SYS_GUID
as PRIMARY KEY
's.
Let's create a sample table and see what's going on:
Read the rest of this entry »