Schemas and bounding views to them

  • Hello friends,

    I want to start indexing my views to get them to run faster, but i'm a bit fuzzy about why i need to bound them to the schema and what is the best way to bound already existing views to a newly created schema.

    Many Thanks!!

    🙂

    Remember
    Without Change something sleeps inside of us that seldom awakens, the sleeper must awaken!!

  • You have to use the "with schemabinding" option when creating the view. This option prevents any changes to the tables that are referenced in the view. There are some other considerations to keep in mind when doing this however (loading data, Clustered index on the view etc..). If this is the only way to speed up performance, then here's an article from technet that has some pretty good information for you.

    http://technet.microsoft.com/en-us/library/cc917715.aspx

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Test carefully. Realize that there isn't any free improvement here. These are additional indexes to maintain on updates, so don't over index.

  • Make sure that you've reviewed the 'laundry list' of requirements for Indexed views. There are a lot of requirements for the query used in the view.

    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
  • Thanks guys for all your sound advice i very much appreciated it 🙂

    All the best for 2010 😎

    Remember
    Without Change something sleeps inside of us that seldom awakens, the sleeper must awaken!!

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

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