prefixing indexes

  • In MySQL its possible to use index a prefix of a column to aid performance. is there an equivalent in SQL server?

  • Could be computed columns, not sure. Could you explain more what the MySQL feature is?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • when creating an index you can filter the index key to read only N number of characters in field e.g abcdefg and not abcdeftgghhjjjjjjjjjjjjjjjjjjjjjjjjjj. I understand that when the field is used in a query there is less of an overhead.

  • To do that in SQL you'd need a computed column on LEFT(other column), then you'd need to filter on that computed column. Not for performance, for when you really are matching on part of the column.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

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