Has Indexed View Materialized?

  • What is the correct way to find out if a given indexed view had materialized indeed? When I look at the query plan for a SELECT statement from that view, it shows all the tables that the view is based on. Therefore I conclude it is not materialized. However all the conditions described in BOL were met. Is there any other thing that tells if an indexed view is materialized?

    Any help would be appreciated.

    Michael

  • You can use the NOEXPAND hint in the query.

    eg. SELECT * FROM MyIndexedView (NOEXPAND)

    If the view is materialised you see an entirely different (and simpler) query plan.

    If the view is not materialised you should get an error.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • Mark, thank you. It helped.

    Michael

    Edited by - mromm on 09/11/2003 5:33:19 PM

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

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