jfauden (1) [Avatar] Offline
#1
Hi,

Whenever I run this queruy I will get SQL for about two or three UPDATE STATISTICS staements followed by:

Msg 50000, Level 16, State 1, Line 57
No indexes found with @RowsToBenchMark > 500000
ian.stirk (27) [Avatar] Offline
#2
Re: Listing 10.6 Intelligent update statistics – time based version
Hi,

Thanks for your question.

In essence, you received this error message because you do not have a relevant index that contains at least 500,000 rows.

The purpose of the script is to reduce the time it takes to intelligently sample the statistics on indexes with lots of rows.

To do this, it first determines how long it takes to update a given number of rows. If there are not many rows in the indexes, it cannot accurately determine how long the statistics will take to update, and so cannot calculate this benchmark. This results in the error message you reported being output.

This routine is really only for indexes with many rows (several million), since taking statistics on smaller indexes should typically complete in a timely manner. I should make this more explicit in the text.

I hope this helps.

Thanks
Ian