What set options should you avoid that cause recompiles

  • I've heard and seen mentioned a few times that certain SET commands force a recompile, I even preach it to others, but I've never backed this up with data.

    Do any of you have a list of these SET commands?

    Thanks,


    John Zacharkan

  • ANSI_DEFAULTS

    ANSI_NULLS

    ANSI_PADDING

    ANSI_WARNINGS

    CONCAT_NULL_YIELDS_NULL

    From MSDN

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Look @ BOL and search for "SET Options That Affect Results"

    Its is under Indexes | Designing Indexes | Gernal Index Design Guidelines.

    Some good tips in there.

  • Thanks everyone


    John Zacharkan

  • Don't know if anyone cares, but I ran into one that I could not find listed in the BOL under "SET Options That Affect Results" which definitely does cause a recompile (left in from an optimization attempt by mistake):

    SET STATISTICS TIME OFF

    SET STATISTICS IO OFF

    Commented out above them were the ONs.

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

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