Home Forums SQL Server 7,2000 T-SQL Create a View with OPTION (FORCE ORDER) RE: Create a View with OPTION (FORCE ORDER)

  • This is interesting (I'll just put my anorak on)

    I have recently been playing with a copy of Quests SQL Central (I don't work for them!!!)  - it rewrites any TSQL statement in different ways to produce the same results then compares the speed and I/O hit of the query to pick the best result.

    The thing is it often uses these OPTION hints and invariably gets better results than my original (not bad efforts) SQL.

    It also likes to use COALESCE to speed up queries as well - it must force the Query Optimiser down a particular route.  Anyway it's all good stuff.

    So maybe SQL doesn't always make the right decisions - usually when the stored proc has too many steps in it.

    Sorry all this isn't much help for the view prob.  SQL is picky on what it allows a view to use. 


    Cheers,

    Sim Lever