using Unicode data in queries

  • We have a live performance problem.  A commerce server object is unfortunately doing an update on our database (bad design which we inherited) and is using sp_executesql with nchar in the primary key field.  The database has char for this field.

    This results in an data type conversion, and SQL chooses the non-clustered index instead of the primary key - with serious performance problems.

    It also seems that the number of rows in the table has an impact in the index choice?

    Is there a patch for this problem?


    When in doubt - test, test, test!

    Wayne

  • You can either FORCE the index WITH(INDEX(PK_HERE)), change the datatype in your table, OR may need to perform INDEX maintenance and everything may go back to normal.

    # of rows has a HUGE impact on which index the system uses.  Small # will ignore the indexes, medium willl use the good indexes (at that time), larger # indexes will need to be reviewed, recompiled, etc....



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply