Summary
It seems fitting that a database filled with data can also produce its own set of data, by monitoring its internal activity and statistics. While in many cases it's more appropriate to set up monitoring using pre-built external tools, as covered in the next chapter, knowing how to directly query and derive interesting values from the database's activity and statistics collector can prove valuable. And when it comes to troubleshooting system performance issues, monitoring activity and locking data yourself is a must.
- The database statistics are exposed using views you can either use all of, or reinterpret by joining with additional system catalog and activity data.
- Most statistics are cumulative values. You'll either need to track how they change over time with an external tool, or regularly reset the totals.
- Particularly valuable statistics to monitor include table/index caching and query index usage statistics.
- Live activity snapshots can be used on their own...