The default slow query collection threshold in TencentDB for SQL Server is one second. SQL statements whose execution duration exceeds one second will be recorded into slow logs.
The default slow query collection threshold in TencentDB for SQL Server is one second, which cannot be modified in the console. To modify it, submit a ticket for assistance. The threshold modification won't affect your business.
Log in to the TencentDB for SQL Server console, click the target instance ID in the instance list, and query and download slow query logs on the slow query log page. The slow SQL table of TencentDB for SQL Server is not displayed by default. You can view it after connecting to the instance through SSMS. If you don't have relevant permissions, submit a ticket for escalating your database account permissions.
Log in to the TencentDB for SQL Server console and click the ID of the target instance to enter the slow query log page. For more information, see Querying and Downloading Slow Query Logs. Download slow logs from the console. The downloaded file is in .xel format. You can open the .xel file in SSMS to view specific slow SQL queries. To optimize slow queries, you can copy them, enable the execution plan feature to view their specific execution plans, and optimize them accordingly. For more information, see Display an Actual Execution Plan.
TencentDB for SQL Server transaction logs will be cleared automatically once every 30 minutes.
Currently, you cannot view error logs in the TencentDB for SQL Server console. However, you can directly view instance logs in SSMS.
Log in to the SQL Server client and run the following query statement in the query box to query error logs:
Exec master.sys.sp_readerrorlog FileID,LogType,FilterText
0indicates the latest log.
exec master.sys.sp_readerrorlog 0,1,'error'