LOCALSTATSUPDATEJOBS System Table Description

Description

The LOCALSTATSUPDATEJOBS pseudo table provides current and historical information about auto-update jobs for Table Statistics (Stats v3). The following will be listed:

  1. All auto-update jobs that are in progress

  2. The 10 most recently completed auto-update jobs

Fields

Field Type Description

OBJECTID

bigint

A unique ID identifying the database object.

SCHEMA

string

The SQL schema of the auto-update job.

TABLENAME

string

The name of the table that requested an auto-update job.

PARTITIONID

bigint

For partitioned tables, the subtable partition ID that requested an auto-update job. Otherwise null.

PARTITIONNAME

string

For partitioned tables, the partition name that requested an auto-update job. Otherwise null.

REQUESTAGE

string

The duration of time since the request was submitted.

REQUESTCOUNT

bigint

The number of requests for auto-update that have been received for this database object since it was placed in the queue.

RUNTIME

string

The duration of time taken to complete the job.

COMPLETEDSTATUS

string

The final status of the job (Successful, Failed).

STATUS

string

The current status of the job (Queued, Generating, Generated). Also provides information about which statistics were generated (scalar and or histograms).

Example

SELECT schema, tablename, completedstatus, status
FROM system.localstatsupdatejobs;
SCHEMA  TABLENAME  COMPLETEDSTATUS         STATUS
 ------- ---------- ---------------- --------------------
   TEST       T1        Successful    Generated histograms