• TheSQLGuru (9/8/2009)


    2) As the plan gets big, the number of permutations (and the CPU effort and duration it takes to calculate them all) grows . . . hmm, is it geometrically or exponentially?

    I suspect it's close to n! (though I haven't bothered to check the theory to confirm). It's pretty bloody fast-growing whichever way. There's a reason why plan generation/plan modification is a major field of research both in databases and artificial intelligence. 😀

    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