Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

N before string literals in query causing performance issue

Vikram ShelkeJul 10 2020 — edited Jul 17 2020

Hi guys,

I have a query which is giving performance issue, taking long time to complete.

Oracle db version - 12c

Using Toad to execute queries.

My query is like

Select *

  From some_table

Where column_name in (:name);

But when I provide value for bind variable during run time the query becomes,

Select *

  From some_table

Where column_name in (N'abcd');

Above is the not actual query I am running, it is just the demo of what is happening with my big query.

Column data type is VARCHAR2 and not NVARCHAR.

Column has simple index on it and my guess is because of this N, the index is not getting used and hence the performance issue.

I search on net and can see few have got this type of problem but didn't find solution.

Also Google tells, N is national language character.

Any suggestions on this would be appreciated.

This post has been answered by mathguy on Jul 11 2020
Jump to Answer
Comments
Post Details
Added on Jul 10 2020
6 comments
1,400 views