Query 1: Select * from table where fieldname = 'abc'

Query 2: Select * from table where fieldname = 'XY�'

  • My query 1 executes in 150mS
  • My query 2 executes in 5000mS

Both return zero results (abc and XY� don't appear in database).

After I run query 2 after which rerun my query 1, query 1 begins taking extended period if it's run in same session (around 2000ms rather than earlier 150ms)

My fieldname is indexed (non-clustered index).

I'm using Adaptive Server Enterprise/12.5.4

I attempted to perform a show arrange for both. Both show same results.

My worries:

  1. Why queries with non ascii figures should harder ? Is the fact that something related to indexes?
  2. Running query 2 shouldn't impact my query 1 response time. Any methods to fix this?

Thanks

I discovered problem to my problem. TIBCO EMS does some changes to unicode chars(non ascii) which in turn causes query plan in sybase to alter with a non enhanced query plan. When utilizing prepared claims in Java query plan's cached ,consequently all future queries become slow.