SQL-сервер avg_user_impact

Это работает, я протестировал его в AppJet (Вы можете вставка копии код его IDE и нажимать "перезагрузку", чтобы видеть, что он работает, не должен создавать учетную запись)

/* appjet:version 0.1 */
function Joes_remove(someArray) {
    var newArray = [];
    var element;
    for( element in someArray){
        if(someArray[element]!=undefined ) {
            newArray.push(someArray[element]);
        }
    }
    return newArray;
}

var myArray2 = [1,2,,3,,3,,,0,,,4,,4,,5,,6,,,,];

print("Original array:", myArray2);
print("Clenased array:", Joes_remove(myArray2) );
/*
Returns: [1,2,3,3,0,4,4,5,6]
*/

7
задан skaffman 28 July 2009 в 14:54
поделиться

1 ответ

The recommended indexes and user impact are both estimates from the cost optimizer, and, as you see there's no guarantee that they are always correct. I think the user impact column can be over 100 by design (though we'd have to hope a MS developer from the SQL Server team is responding here for the real answer.) It is always vital to test whether creating the indexes shown in the DMV will work or not. I have had the same experience where an index is shown there, but once created doesn't actually get used, perhaps due to the details of the query or the data distribution in the tables, etc. The view is right most of the time, especially for simple cases, but not always.

Also, be careful about creating really wide indexes, as they might hurt insert/update performance more than they help select performance, depending on how busy the server is.

7
ответ дан 7 December 2019 в 07:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: