How to add indexed columns to improve SPQuery performance

已答复 How to add indexed columns to improve SPQuery performance

  • 2012年6月28日 1:57
     
     

    Hi,

    My document library contains 5000+ items, so I plan to use indexed columns to improve SPQuery performance.

    What I want to know it which columns should be indexed column.

    Generally, it is said that I have better choose the columns used in <where> clause as indexed columns.

    But in my SPQuery.Query, here is no <where> clauses used. Only SPQuery.Folder, ViewAttribute, ViewField are set. ( target folder, "Scope='Recursive'", "<FieldRef Name='target field' />" respectively)

    Hope someone helps me.

    Regards,

全部回复

  • 2012年6月29日 7:09
    版主
     
     已答复

    Hi Thomas2012,

    When dealing with large lists, throttling kicks in on sort, where and join operations of dealing with non-indexed columns, the correct way to deal with large lists is to index any columns that would be used or any sorting, filtering or lookups. If don’t use these in your query, you may not need to set indexed columns, more information, see:
    http://msdn.microsoft.com/en-us/library/ff798465.aspx

    Thanks,


    Qiao Wei

    TechNet Community Support