concept give routine in category sql

This is an excerpt from Manning's book SQL Server DMVs in Action: Better Queries with Dynamic Management Views.
If you know which indexes are used by a given routine, you can pre-optimize these indexes before the next time the routine is run, ensuring optimal performance. The script we use to identify the indexes used by a given routine is shown here.
![]()
Here you can see that a single DMV and four system tables are involved in identifying the indexes used by a given routine; a brief description of each is given in table 3.8.
Table 3.8. DMV/system tables to identify the index usage
DMV/tables
Description
sys.dm_db_index_usage_stats Contains details of the different types of index operations, for example, number of updates by user queries sys.indexes Contains details for each index, for example, name and type sys.sysindexes Contains details of row counts and row changes (since last update statistics run) sys.tables Contains details of table objects, for example, name sys.schemas Contains details of schema objects, for example, name By joining the DMV with the system tables, we have enough information to identify the indexes used by a given routine and how they’re used. The DMV joins to the system table sys.indexes on their common key columns, object_id and index_id. The other system tables typically provide descriptive information.