doc-exports/docs/rds/umn/rds_09_0009.html
Ru, Li Yi f51ec873f3 rds_umn
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-06-05 10:42:11 +00:00

2.2 KiB

Updating Database Statistics

Scenarios

You can use a stored procedure to update statistics to improve query performance.

Prerequisites

An RDS Microsoft SQL Server DB instance has been connected. For details about how to connect to a DB instance, see Connecting to a DB Instance Through a Public Network.

Procedure

Run the following command to update statistics on all databases by default:

EXEC rdsadmin.dbo.rds_updatestats ;

Run the following command to update statistics on a specified database:

EXEC rdsadmin.dbo.rds_updatestats '@DBname' ;

The '@DBname' parameter indicates the name of the database whose statistics are to be updated.

Example:

EXEC rdsadmin.dbo.rds_updatestats 'MyTestDb' ;

After the database statistics are updated, the system displays the following information: