Calling QueryRows for Small Tables

Applies to: Outlook 2013 | Outlook 2016

When retrieving rows from a small table, call IMAPITable::QueryRows instead of first building a restriction. Creating a restriction impacts performance because the provider must first create a table, find the matching rows in the original table, and then copy the rows to the new table. If the total number of rows in the table is less than 100, it is probably more effective to read all of the rows and then call IMAPITable::FindRow to find the appropriate row. This is a particularly good strategy if this information is needed only occasionally.

The proper time to use a restriction is when the restricted or filtered information will be used over a longer period of time or used frequently. For instance, if you always need a view with unread messages, then a restriction is the proper call to use.