Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » Tables » Diagnostic tracing tables

sa_diagnostic_internalvariable table Next Page

sa_diagnostic_query table


The sa_diagnostic_query table is owned by the dbo user, and stores optimization information for queries, especially the context in which they were optimized. A row in this table represents an invocation of the optimizer for a query. Plans captured at optimization time are stored here.

Some of the values in this table mirror database option values.

There are two versions of this table: sa_diagnostic_query, and sa_tmp_diagnostic_query.

Columns
Column name Column type Column constraint Table constraints
logging_session_idUNSIGNED INTNOT NULLPrimary key. Foreign key references sa_diagnostic_statement
query_idUNSIGNED BIGINTNOT NULLPrimary key. Foreign key references sa_diagnostic_statement.
statement_idUNSIGNED BIGINTNOT NULL
user_object_idUNSIGNED BIGINTNOT NULL
start_timeTIMESTAMPNOT NULL
cache_size_bytesUNSIGNED BIGINT
optimization_goalTINYINT
optimization_levelTINYINT
user_estimatesTINYINT
optimization_workloadTINYINT
available_requestsTINYINT
active_requestsTINYINT
max_tasksTINYINT
used_bypassTINYINT
estimated_cost_msTINYINT
plan_explainLONG VARCHAR
plan_xmlLONG VARCHAR
sql_rewrittenLONG VARCHAR

logging_session_id    The ID of the logging session during which the query or request occurred.

query_id    A number uniquely identifying the query.

statement_id    A number uniquely identifying a statement in a query.

user_object_id    The object ID of the user under which this query was executed. If the query was run from a procedure, this would be the user ID of the procedure owner.

start_time    The time at which this query was optimized.

cache_size_bytes    The size, in bytes, of the cache at the time this query was optimized.

optimization_goal    Determines whether query processing is optimized towards returning the first row quickly, or minimizing the cost of returning the complete result set. This value reflects the value of the optimization_goal database option.

To see possible values for this column, see optimization_goal option [database].

optimization_level    Controls the amount of effort made by the SQL Anywhere query optimizer to find an access plan for a SQL statement. This value reflects the value of the optimization_level database option.

To see possible values for this column, see optimization_level option [database].

user_estimates    Controls whether or not user selectivity estimates in query predicates are respected or ignored by the query optimizer. This value reflects the value of the user_estimates database option.

To see possible values for this column, see user_estimates option [database].

optimization_workload    Determines whether query processing is optimized towards a workload that is a mix of updates and reads or a workload that is predominantly read-based. This value reflects the value of the optimization_workload database option.

To see possible values for this column, see optimization_workload option [database].

available_requests    Used internally to compute the level of intra-query parallelism.

active_requests    Used internally to compute the level of intra-query parallelism.

max_tasks    Used internally to compute the level of intra-query parallelism.

used_bypass    Whether a simple query bypass was used. A value of 1 indicates a bypass was used; a value of 0 indicates that the query was fully optimized.

estimated_cost_ms    The estimated cost, in milliseconds.

plan_explain    A text plan representation of this query.

plan_xml    A graphical plan representation of the query (if one was recorded).

sql_rewritten    Text of a query after applying optimizations. A value will only be present in this column if optimization logging is enabled.

See also