• RBarryYoung (1/31/2009)


    Marios Philippopoulos (1/31/2009)


    I have a trigger that appears to execute a very large number of logical reads; on one occasion it has hit 73,421,728 logical reads!

    Is this for one execution of the trigger? Or is it a total over a period of time?

    It's a snapshot in time. Here is the query I use to capture the info:

    SELECT

    R.start_time

    ,R.status

    ,R.command

    ,R.database_id

    ,S.host_name

    ,S.program_name

    ,S.client_interface_name

    ,S.login_name

    ,R.wait_type

    ,R.wait_time

    ,R.last_wait_type

    ,R.wait_resource

    ,R.cpu_time

    ,R.total_elapsed_time

    ,R.reads

    ,R.writes

    ,R.logical_reads

    ,T.text

    ,P.query_plan

    FROM

    sys.dm_exec_requests R

    INNER JOIN

    sys.dm_exec_sessions S

    ON

    R.session_id = S.session_id

    OUTER APPLY

    sys.dm_exec_sql_text(R.sql_handle) AS T

    OUTER APPLY

    sys.dm_exec_query_plan(R.plan_handle) AS P

    WHERE

    R.session_id > 50;

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]