What are the wait stats I can track for page compression

Burt King 6 Reputation points
2021-10-22T00:25:24.117+00:00

I am trying to track the expense of page compression in sql server with wait stats. What events should I be looking for? Ideally I'd like to understand CPU consumption.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,675 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ronen Ariely 15,096 Reputation points
    2021-10-22T01:22:24.677+00:00

    Hi,

    Note: You can use sys.dm_db_index_operational_stats() which provides the page_compression_attempt_count and page_compression_success_count available.

    The events which you can track are: sqlserver.page_compression_attempt_failed and sqlserver.page_compression_tracing

    1 person found this answer helpful.

  2. Tom Phillips 17,716 Reputation points
    2021-10-22T18:20:07.95+00:00

    I do not believe there is a wait state for that information.

    Page compression only operates on an 8k page at a time. So it has very little impact, unless you are doing bulk inserts and many pages are changing.

    I suggest you read this:
    https://learn.microsoft.com/en-us/sql/relational-databases/data-compression/page-compression-implementation?view=sql-server-ver15#when-page-compression-occurs

    0 comments No comments

  3. Erland Sommarskog 100.9K Reputation points MVP
    2021-10-23T10:10:32.04+00:00

    I don't see why page compression as such would produce more waits. After all, page compression is something that happens on the CPU, and wait stats reflects what happens outside the CPU. Well, with the exception for the preemptive waits, that is, when SQL Server runs code outside SQL Server, but that is not the case here.

    However, increased CPU usage does exhibit in one way in the page stats, you get more SOS_SCHEDULER_WAITs. This wait type is registered every time a process yields voluntarily to let other processes execute. If there is idle CPU, the wait as such will be short, but the number of waits will go up by one.

    But I am not sure that this is the best way to track CPU usage.

    0 comments No comments