Query is performing so slow after encryption

  • [font="Tahoma"]

    Hi all,

    I using encryption to encrypt one column in my database but after I encrypte and try to select with condition as following syntax

    Select * from [MYTABLE] where [dbo].[the Function I created for Decryption]([MYCOLUMN])='THE VALUE'

    it take around 15 Minutes !!!!!

    My table rows are 200,000 rows

    has anyone had idea what can I do to enhance my query performance

    Thanks in Advance

    [/font]

  • Can you get an execution plan and attach it? Here's a video on JumstartTV that explains how to upload an execution plan to SSC (free registration required).

    By using a UDF on the column you eliminate the possibility of an index seek. I have not worked with encryption, but I would assume you could Encrypt the criteria value and compare encrypted values.

  • Try the following query instead

    Select * from [MYTABLE] where [MYCOLUMN]= [dbo].[the Function I created for Decryption]('THE VALUE')

    This allows SQL to utilise any indexes that it thinks appropriate.

  • I think you actually need to use:-

    Select * from [MYTABLE] where [MYCOLUMN]= [dbo].[the Function I created for Encryption]('THE VALUE')

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

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