I have a table in Oracle 10 with following structure
Create Table Bookmarks(
BOOKMARKID NUMBER(10,0) NOT NULL PRIMARY KEY,
URL VARCHAR2(4000 CHAR) NOT NULL UNIQUE
)
URL has a unique constraint set thus a unique index. There are about 1 million records in this table. I have to frequently check if a bookmark already exists in the table. I am issuing the following query
Select bookmarkid from Bookmarks where URL='<some url>'
The problem is that as the number of records have grown so has the performance gone down. Now It takes significantly longer to return the bookmark id specially when the query URL is long. In the Explain Plan the query does use Unique index on URL column. Any suggestions for improving response time?