Evgeny Tugarev

blog

  Home  |   Contact  |   Syndication    |   Login
  3 Posts | 0 Stories | 57 Comments | 2 Trackbacks

News



Archives

Image Galleries

In the top-level SharePoint list views I often order items by the "Last Updated" column. Corresponding xml fragment of the list schema.xml looks like

<View  BaseViewID="0" Type="HTML" ContentTypeID="0x012001">......
       <Query>
          <OrderBy>
            <FieldRef Name="DiscussionLastUpdated" Ascending="FALSE">
            </FieldRef>
          </OrderBy>
        </Query>
</View>

When a SPList contains large number of items it is also vital to define "Last Updated" as indexed column to keep having good performance. Go up to the field definitions and add  Indexed="TRUE"  property to the "Last Updated" field.

<Field ID="{59956c56-30dd-4cb1-bf12-ef693b42679c}" Name="DiscussionLastUpdated" DisplaceOnUpgrade="TRUE" ... Indexed="TRUE">

And don't forget to rebuild you .wsp if you have one

Cheers,

Evgeny Tugarev

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Wednesday, July 09, 2008 10:31 AM