I have a table that has among others, two columns
SPONSOR_ID number
NR_CERTIFICATE char(11)
And there's a index for these two columns
NR_CERTIFICATE + SPONSOR_ID
This table has hundreds of thousands of rows, and the problem is, when we filter by a specific certificate, the select takes nanoseconds as expected:
SELECT * FROM TBL_XXX WHERE NR_CERTIFICATE = '33300123456'
the problem is when we use LIKE to filter:
SELECT * FROM TBL_XXX WHERE NR_CERTIFICATE LIKE '%123456'
Then the select takes around 15 seconds.
I know that in this case, the index is discarded and a table scan takes place. Is there a way to force ORACLE to use the index in this case? Or is there a way to speed up this select?