SqlBLT Data Dictionary

SqlBLT 20261130.1.2 ยท 30 November 2026

1. Summary

SqlBLT logs blocked requests, the heads of blocking chains and long running requests, and collects instance metrics, into the database it is installed in. This document describes that database as the script SqlBLT-install.sql creates it.

  • Schema SqlBLT: 52 tables with 580 columns, 5 views, 6 procedures, the parsing functions, a table type and a trigger. SqlBLT.AggregateMetrics creates two more tables, memory-optimized work tables, when its setting InMemoryWorkTables is 1.
  • Schema SqlBLTPortal: the 11 read-only report procedures of the SqlBLT Portal, with three table types, and the database role SqlBLT_Reader, which may execute them.
  • Jobs: SqlBLT_Collector and SqlBLT_Metrics every 10 seconds, SqlBLT_Aggregate every 10 minutes.

Conventions

  • Names. A table is named for its process: ref_ dictionaries and templates, agg_ aggregates, metric_ metrics, config_ configuration, log_ one row per execution of a process, size_ the size log.
  • Time. now is the time of a poll or run, from getdate(): the local time of the server. agg_time is the start of the second, minute, hour or day that an aggregate row covers.
  • Ids. A name or value is stored once in SqlBLT.ref_value and held elsewhere as its bpat_value_id; sqltextid and qplanid are the ids of a text template and a plan template.
  • No value. NULL. In a key column of an aggregate table, which is part of the primary key, -1 (blt: '-') when the set of the row lacks the dimension; scope_id 0 for a metric that is not per database.
  • References. An installation has no foreign key constraints: the procedures maintain the references that the diagram and the Key columns show. SqlBLT.SetForeignKeys creates or drops the 137 foreign keys, all of them or those of one section.
  • Partitions and retention. session_base, the four aggregate tables and the four metric tables are partitioned by day, each on a partition function of its own, with page compression. SqlBLT.MaintainPartitions truncates the partitions that SqlBLT.config_partition no longer retains. The dictionary, configuration, log and size tables are not partitioned and keep their rows; text and plan templates are deleted when the last session_base partition that references them is truncated and no aggregate row references them.
GroupTablesHolds
Capturesession_base, request_stateOne row per sampled session per poll: the blocked requests (B), the heads of blocking chains (T) and the long running requests (L), each with its wait, the resource waited for, its statement and plan, and its work since the previous poll. request_state keeps each request's last counters for that calculation.
Dictionaries and templatesref_type, ref_value, ref_sqltext, ref_sqltext_key, ref_qplan, ref_qplan_key, ref_qplan_hash, ref_request, ref_counts, ref_missing_index, ref_query_missing_indexEach name or value once (database, host, login, program, wait type, resource and others), referred to by id; each statement text and each query plan once, as a de-parameterised template; each request once; the number of references that the rows hold to each text, plan and value; the missing index recommendations of SQL Server for the queries of the requests captured.
Query plan attributesref_qplan_value, ref_qplan_attribute, ref_qplan_time, ref_qplan_column, ref_qplan_index, ref_qplan_convert, ref_qplan_att_no_statistics, ref_qplan_att_convert, ref_qplan_att_unmatched_index, ref_query_qplan_attributeWhat the plan of a request carries besides its shape: the warnings of the query optimizer with the columns, conversions and indexes they name, the plan guide, the reasons and the compile values; each text value once.
Aggregatesagg_second, agg_minute, agg_hour, agg_day, agg_set, agg_dimensionSamples, sums and maxima of the captured rows per second, minute, hour and day, for each enabled set of dimensions.
Metricsmetric, metric_base, metric_minute, metric_hour, metric_day, metric_scope, metric_state, metric_wait_skip, metric_agg_polls, metric_agg_rowsThe 115 metrics of metric, sampled at every run and aggregated per minute, hour and day.
Configconfig_setting, config_partition, config_versionThe settings of the procedures, the boundary period and the retention of each partition function, and the versions installed.
Logginglog_capture, log_capture_error, log_aggregate, log_metrics, log_metrics_aggregate, log_metrics_error, log_maintenance, log_maintenance_partitionOne row per poll, metrics run, aggregation batch and maintenance execution, with its timings and outcome; the errors.
Sizesize_type, size_object, size_table, size_partitionThe size log: the size of every table and of each daily partition that holds rows, logged once a day by the daily maintenance, and the data type of each table.
Viewssessions, aggregate_second, aggregate_minute, aggregate_hour, aggregate_dayThe captured rows and the aggregate rows with every id rendered as its name or value.

2. Entity relationship diagram

a column of the table at the crow's foot holds the key of the table at the bar33the number of columns a line stands forPKprimary key columnFKcolumn that holds the key of another tablea title opens the description of the table
CaptureDictionaries and templatesQuery plan attributesAggregatesMetricsConfigLoggingSizeViews111111331112111143644413131111113231111session_baseqplan_att_id, qplan_time_id: ref_qplan_attribute, ref_qplan_time (not drawn)PKnowdatetimePKrow_idintFKreq_status_idint null→ ref_valueFKsession_status_idint null→ ref_valueFKcommand_idint null→ ref_valueFKconn_db_idint null→ ref_valueFKauth_db_idint null→ ref_valueFKsqltext_objname_idint null→ ref_valueFKwait_dbname_idint null→ ref_valueFKwait_schname_idint null→ ref_valueFKwait_objname_idint null→ ref_valueFKwait_object_type_idint null→ ref_valueFKwait_indexname_idint null→ ref_valueFKwait_filename_idint null→ ref_valueFKwait_filepath_idint null→ ref_valueFKwait_resource_idint null→ ref_valueFKlast_wait_type_idint null→ ref_valueFKwait_type_idint null→ ref_valueFKtask_wait_type_idint null→ ref_valueFKreq_mode_idint null→ ref_valueFKtran_name_idint null→ ref_valueFKresource_type_idint null→ ref_valueFKresource_subtype_idint null→ ref_valueFKresource_descr_idint null→ ref_valueFKhost_name_idint null→ ref_valueFKprogram_name_idint null→ ref_valueFKclient_interface_idint null→ ref_valueFKlogin_name_idint null→ ref_valueFKnet_transport_idint null→ ref_valueFKprotocol_type_idint null→ ref_valueFKencrypt_option_idint null→ ref_valueFKauth_scheme_idint null→ ref_valueFKclient_net_addr_idint null→ ref_valueFKlocal_net_addr_idint null→ ref_valueFKerror_message_idint null→ ref_valueFKsqltextidint null→ ref_sqltextFKqplanidint null→ ref_qplanFKqplan_att_idint null→ ref_qplan_attributeFKqplan_time_idint null→ ref_qplan_time+ 70 other columnsrequest_statePKsession_idsmallintPKlast_req_startdatetimereq_cpu_msbigintreq_logical_readsbigintreq_phys_readsbigintreq_writesbigintwait_time_msbigintwait_typenvarchar(256) nullsql_handlevarbinary(64) nullstmt_start_offsetint nullstmt_end_offsetint nulllast_nowdatetimeref_valuePKbpat_value_idintFKbpat_idsmallint null→ ref_typebpat_value_hashbinary(16) nullbpat_valuenvarchar(3072) nullref_sqltext_keyPKsqltext_chashvarchar(88)FKsqltextidint→ ref_sqltextref_sqltextPKsqltextidintsqltext_chashvarchar(88) nullsqltext_parsedvarbinary(max) nullsqltext_unparsedvarbinary(max) nullsqltextleadingnvarchar(2048) nullref_qplanPKqplanidintqplan_chashvarchar(88) nullqplan_parsedvarbinary(max) nullqplan_unparsedvarbinary(max) nullref_countsobjid, ref_objid: size_object.objid (not drawn)PKFKobjidsmallint→ size_objectPKFKref_objidsmallint→ size_objectPKref_idintref_countbigintref_typePKbpat_idsmallintbpat_attributenvarchar(128)ref_requestPKrequest_idintsession_idsmallint nulllast_req_startdatetime nullfirst_nowdatetime nulllast_nowdatetime nullFKsqltextid_firstint null→ ref_sqltextFKsqltextid_lastint null→ ref_sqltextFKqplanid_lastint null→ ref_qplanref_qplan_keyPKqplan_chashvarchar(88)FKqplanidint→ ref_qplanref_qplan_hashPKquery_plan_hashbinary(8)FKqplanidint→ ref_qplanref_query_missing_indexPKFKsqltextidint→ ref_sqltextPKquery_hashbinary(8)PKquery_plan_hashbinary(8)PKFKmissing_index_idint→ ref_missing_indexfirst_seendatetimelast_seendatetimeavg_user_impactfloat nulluser_seeksbigint nulluser_scansbigint nullavg_total_user_costfloat nullgroup_handleint nullref_missing_indexPKmissing_index_idintmissing_index_hashbinary(16)dbnamenvarchar(128) nullschnamenvarchar(128) nullobjnamenvarchar(128) nullequality_columnsnvarchar(4000) nullinequality_columnsnvarchar(4000) nullincluded_columnsnvarchar(4000) nullagg_second, agg_minute, agg_hour, agg_dayfour tables with the same columnsPKagg_timedatetimePKFKset_idsmallint→ agg_setPKFKdatabase_idint→ ref_valuePKFKwait_dbname_idint→ ref_valuePKFKwait_schname_idint→ ref_valuePKFKwait_objname_idint→ ref_valuePKFKprogram_name_idint→ ref_valuePKFKsqltextidint→ ref_sqltextPKFKhost_name_idint→ ref_valuePKFKlogin_name_idint→ ref_valuePKFKwait_type_idint→ ref_valuePKFKqplanidint→ ref_qplanPKbltchar(1)PKFKresource_type_idint→ ref_valuePKFKrequest_idint→ ref_requestsamplesintpolls_presentintsessions_maxintsession_secondsbigintwait_msbigintwait_ms_maxbigintelapsed_ms_maxbigintcpu_msbigintlogical_readsbigintphysical_readsbigintwritesbigintchild_wait_msbigintchild_wait_ms_maxbigintstmt_wait_msbigint nullstmt_cpu_msbigint nullstmt_logical_readsbigint nullstmt_physical_readsbigint nullstmt_writesbigint nullagg_setPKset_idsmallintnamevarchar(60)has_databasebithas_objectbithas_applicationbithas_querybithas_hostbithas_loginbithas_wait_typebithas_planbithas_bltbithas_resource_typebithas_requestbitat_secondbitat_minutebitat_hourbitat_daybitenabledbitdescriptionvarchar(200)agg_dimensionPKbitsmallintnamevarchar(20)key_columnsvarchar(60)source_columnsvarchar(60)ref_tablevarchar(20)ref_attributesvarchar(20)descriptionvarchar(200)config_partitionPKfunction_namesysnameboundary_periodvarchar(5)future_boundariesintpartitions_retainedintconfig_versionPKversionchar(13)installeddatetimeupgraded_fromchar(13) nullconfig_settingPKprocedure_namesysnamePKsetting_namesysnamevaluebigintmin_valuebigintmax_valuebigintdescriptionnvarchar(400)metricPKmetric_idsmallintnamenvarchar(128)categoryvarchar(16)sourcechar(1)kindchar(1)unitvarchar(16)patternnvarchar(128) nullobject_namenvarchar(128) nullcounter_namenvarchar(128) nullinstance_namenvarchar(128) nullbase_counternvarchar(128) nullper_databasebitenabledbitshownbitsort_ordersmallintdescriptionnvarchar(400)metric_basePKnowdatetimePKFKmetric_idsmallint→ metricPKFKscope_idint→ metric_scopevaluefloatsecondsintmetric_minute, metric_hour, metric_daythree tables with the same columnsPKagg_timedatetimePKFKmetric_idsmallint→ metricPKFKscope_idint→ metric_scopesamplesintsecondsintvalue_sumfloatvalue_minfloatvalue_maxfloatvalue_lastfloatmetric_scopePKscope_idintnamesysname nullfirst_seendatetime nulllast_seendatetime nullmetric_agg_polls, metric_agg_rowsmemory-optimized work tables, created on demandmetric_wait_skipPKpatternnvarchar(128)metric_statePKmetric_idsmallintPKscope_idintsampleddatetimerawfloat nullraw_basefloat nullsessions (view)over session_base, with every dictionary id rendered as its valueSqlBLT.Collect inserts through its INSTEAD OF trigger tr_sessionsreads session_base, ref_value, ref_sqltext, ref_qplan113 columnsaggregate_second, _minute, _hour, _day (views)four views with the same columns, one over each aggregate tablereads its aggregate table, agg_set, ref_value, ref_sqltext, ref_request43 columnsref_qplan_attributeqplanid: ref_qplan.qplanid (not drawn)the four ids of text values: ref_qplan_value (not drawn)PKqplan_att_idintFKqplanidint→ ref_qplanatt_hashbinary(16)use_planbit nullce_model_versionsmallint nullno_join_predicatessmallintFKplan_guide_db_idint null→ ref_qplan_valueFKplan_guide_name_idint null→ ref_qplan_valueFKnon_parallel_plan_reason_idint null→ ref_qplan_valueFKoptm_early_abort_reason_idint null→ ref_qplan_valueref_query_qplan_attributesqltextid: ref_sqltext.sqltextid (not drawn)PKFKsqltextidint→ ref_sqltextPKFKqplan_att_idint→ ref_qplan_attributefirst_seendatetimelast_seendatetimeref_qplan_timeqplanid: ref_qplan.qplanid (not drawn)PKqplan_time_idintFKqplanidint→ ref_qplancompile_msint nullcompile_cpu_msint nullcompile_memory_kbint nullserial_desired_memory_kbbigint nulllast_seendatetimeref_qplan_att_no_statisticsPKFKqplan_att_idint→ ref_qplan_attributePKFKqplan_column_idint→ ref_qplan_columnref_qplan_att_convertPKFKqplan_att_idint→ ref_qplan_attributePKFKqplan_convert_idint→ ref_qplan_convertref_qplan_att_unmatched_indexPKFKqplan_att_idint→ ref_qplan_attributePKFKqplan_index_idint→ ref_qplan_indexref_qplan_columnPKqplan_column_idintcolnamenvarchar(128)FKdbname_idint null→ ref_qplan_valueFKschname_idint null→ ref_qplan_valueFKobjname_idint null→ ref_qplan_valueref_qplan_convertPKqplan_convert_idintFKqplan_column_idint null→ ref_qplan_columnexpressionnvarchar(400)FKconvert_issue_idint→ ref_qplan_valueFKto_type_idint null→ ref_qplan_valueref_qplan_indexPKqplan_index_idintindexnamenvarchar(128)FKdbname_idint null→ ref_qplan_valueFKschname_idint null→ ref_qplan_valueFKobjname_idint null→ ref_qplan_valueref_qplan_valuePKqplan_value_idintqplan_valuenvarchar(128)log_capturePKnowdatetimeversionchar(13)rows_returnedintduration_msintms_classifyint nullms_detailint nullms_resolveint nullms_cacheint nullms_captureint nullcyclesint nullms_text_fetchint nullms_plan_fetchint nullplans_fetchedint nullplans_skippedint nulltexts_parsedint nulltext_chars_parsedint nullms_text_parseint nullplans_parsedint nullplan_chars_parsedint nullplan_chars_maxint nullms_plan_parseint nullms_plan_parse_maxint nullms_storeint nullwindow_msint nullms_missing_indexint nullmissing_indexesint nullms_qplan_attributeint nulllog_capture_errorPKnowdatetimePKidintpasschar(2)dbidint nullerror_numberint nullerror_messagenvarchar(2048) nullsession_row_idint nullsession_idint nullBLTchar(1) nulllog_aggregatePKaggregate_idintstarteddatetimeendeddatetime nullversionchar(13)polls_fromdatetimepolls_todatetimepollsintrows_readint nullrows_secondint nullrows_minuteint nullrows_hourint nullrows_dayint nullms_readint nullms_groupint nullms_writeint nulloutcomevarchar(10)error_messagenvarchar(2048) nullms_totalint nulllog_metricsPKnowdatetimeversionchar(13)rows_writtenintsecondsint nullduration_msintwaitsintcountersintio_rowsintms_waitsint nullms_countersint nullms_otherint nullms_ioint nullms_storeint nulllog_metrics_aggregatePKaggregate_idintstarteddatetimeendeddatetime nullversionchar(13)polls_fromdatetimepolls_todatetimepollsintrows_readint nullrows_minuteint nullrows_hourint nullrows_dayint nulloutcomevarchar(10)error_messagenvarchar(2048) nullms_totalint nulllog_metrics_errorPKnowdatetimeerror_numberint nullerror_messagenvarchar(2048) nulllog_maintenancePKmaint_idintstarteddatetimeendeddatetime nullversionchar(13)outcomevarchar(10)error_messagenvarchar(2048) nullms_totalint nullboundaries_splitint nullpartitions_truncatedint nullboundaries_mergedint nullrows_truncatedbigint nullsqltext_deletedint nullqplans_deletedint nullref_rebuild_msint nullref_counts_correctedint nulllog_maintenance_partitionPKFKmaint_idint→ log_maintenancePKpart_idintfunction_namesysnametable_namesysname nullrange_fromdatetime nullrange_todatetime nullsplit_msint nulltruncate_msint nullrows_truncatedbigint nullsqltext_deletedint nullqplans_deletedint nullmerge_msint nullsize_tablePKFKmaint_idint→ log_maintenancePKFKobjidsmallint→ size_objectrowsbigintreserved_kbbigintdata_kbbigintindex_kbbigintunused_kbbigintsize_partitionPKFKmaint_idint→ log_maintenancePKFKobjidsmallint→ size_objectPKpart_idsmallintrange_fromdatetime nullrange_todatetime nullrowsbigintreserved_kbbigintdata_kbbigintindex_kbbigintunused_kbbigintsize_typePKtypeidsmallinttypenamevarchar(20)grainvarchar(10) nullsize_objectPKobjidsmallintobjnamesysnameFKtypeidsmallint null→ size_type

3. Tables

3.1 Capture

One row per sampled session per poll: the blocked requests (B), the heads of blocking chains (T) and the long running requests (L), each with its wait, the resource waited for, its statement and plan, and its work since the previous poll. request_state keeps each request's last counters for that calculation.

SqlBLT.session_base

The captured rows: at every poll, each blocked request (B), each head of a blocking chain (T) and each long running request (L), with its session and connection, its wait and the resource waited for, its transaction, its statement and plan, and its work in the poll's window (the columns ending in _inc). A name or value is held as the id of its SqlBLT.ref_value row; the statement text and the plan as the ids of their templates.

Rows
One row per sampled session per poll.
Written by
SqlBLT.Collect, through the view SqlBLT.sessions and its trigger
Primary key
now, row_id, clustered
Storage
Partitioned by now on scheme psSqlBLT (function pfSqlBLT): a boundary per day, 14 partitions retained as installed. Page compression.
ColumnTypeNullableKeySourceAggregated as
nowdatetimenot nullPKgetdate() at the start of the pollagg_time (the poll time cut to the second, minute, hour and day)
row_idintnot nullPKThe number of the row within the pollsamples (the rows counted)
BLTchar(1)nullB a blocked request, T the head of a blocking chain, L a long running request; decided from sys.dm_exec_requests.blocking_session_id and start_timeblt
session_idsmallintnullsys.dm_exec_requests.session_id; for a blocker without a request, blocking_session_id of the request it blocksrequest_id (with last_req_start_time: SqlBLT.ref_request)
blockedsmallintnullsys.dm_exec_requests.blocking_session_id
topblockintnullThe session at the head of the blocking chain, followed through blocking_session_id
req_status_idintnull→ ref_valuesys.dm_exec_requests.status; dictionary attribute 1 (req_status)
session_status_idintnull→ ref_valuesys.dm_exec_sessions.status; dictionary attribute 2 (session_status)
open_transintnullsys.dm_exec_sessions.open_transaction_count (sys.sysprocesses.open_tran before SQL Server 2012)
elapsed_msbigintnullThe poll time minus sys.dm_exec_requests.start_timeelapsed_ms_max
wait_time_msbigintnullsys.dm_exec_requests.wait_timewait_ms_max
req_cpu_msbigintnullsys.dm_exec_requests.cpu_timeread to tell whether the counters of the row are known
req_logical_readsbigintnullsys.dm_exec_requests.logical_readsread to tell whether the counters of the row are known
req_phys_readsbigintnullsys.dm_exec_requests.readsread to tell whether the counters of the row are known
req_writesbigintnullsys.dm_exec_requests.writesread to tell whether the counters of the row are known
mem_usedbigintnullsys.dm_exec_sessions.memory_usage
command_idintnull→ ref_valuesys.dm_exec_requests.command (sys.sysprocesses.cmd when the session has no request); dictionary attribute 3 (command)
conn_dbidintnullsys.dm_exec_sessions.database_id (sys.sysprocesses.dbid before SQL Server 2012)
conn_db_idintnull→ ref_valuedb_name() of sys.dm_exec_sessions.database_id; dictionary attribute 4 (conn_db)database_id
auth_dbidintnullsys.dm_exec_sessions.authenticating_database_id
auth_db_idintnull→ ref_valuedb_name() of sys.dm_exec_sessions.authenticating_database_id; dictionary attribute 5 (auth_db)
sqltext_sourcechar(1)nullWhere the text came from: S the statement by its offsets, B the batch or module (sys.dm_exec_sql_text), I the input buffer (sys.dm_exec_input_buffer), N none
sqltext_objname_idintnull→ ref_valueSchema and name of the module, from objectid and dbid of sys.dm_exec_sql_text; dictionary attribute 6 (sqltext_objname)
wait_dbidbigintnullThe database id parsed from sys.dm_os_waiting_tasks.resource_description, else from sys.dm_exec_requests.wait_resource
wait_dbname_idintnull→ ref_valuedb_name() of the database id parsed from the wait resource; dictionary attribute 7 (wait_dbname)wait_dbname_id
wait_schname_idintnull→ ref_valuesys.schemas.name of the waited object; dictionary attribute 8 (wait_schname)wait_schname_id
wait_objname_idintnull→ ref_valuesys.objects.name of the waited object; dictionary attribute 9 (wait_objname)wait_objname_id
wait_object_type_idintnull→ ref_valuesys.objects.type of the waited object; dictionary attribute 10 (wait_object_type)
wait_index_idintnullsys.partitions.index_id of the waited partition
wait_indexname_idintnull→ ref_valuesys.indexes.name of that index; dictionary attribute 11 (wait_indexname)
wait_partition_numberintnullsys.partitions.partition_number
wait_filename_idintnull→ ref_valuesys.database_files.name of the waited file; dictionary attribute 12 (wait_filename)
wait_filepath_idintnull→ ref_valuesys.database_files.physical_name of the waited file; dictionary attribute 13 (wait_filepath)
wait_object_idbigintnullsys.objects.object_id, found through sys.partitions or sys.allocation_units; for a page through sys.dm_db_page_info or DBCC PAGE
wait_file_idbigintnullThe file id parsed from the wait resource
wait_resource_idintnull→ ref_valuesys.dm_exec_requests.wait_resource; dictionary attribute 14 (wait_resource)
last_wait_type_idintnull→ ref_valuesys.dm_exec_requests.last_wait_type; dictionary attribute 15 (last_wait_type)
connect_timedatetimenullsys.dm_exec_connections.connect_time
last_req_end_timedatetimenullsys.dm_exec_sessions.last_request_end_time
last_req_start_timedatetimenullsys.dm_exec_sessions.last_request_start_timerequest_id (with session_id: SqlBLT.ref_request)
wait_type_idintnull→ ref_valuesys.dm_exec_requests.wait_type; dictionary attribute 16 (wait_type)wait_type_id
task_wait_type_idintnull→ ref_valuesys.dm_os_waiting_tasks.wait_type; dictionary attribute 17 (task_wait_type)
task_wait_msbigintnullsys.dm_os_waiting_tasks.wait_duration_ms
is_userbitnot null default 0sys.dm_exec_sessions.is_user_process
req_mode_idintnull→ ref_valueThe lock mode parsed from sys.dm_os_waiting_tasks.resource_description; dictionary attribute 18 (req_mode)
tran_begin_timedatetimenullThe earliest sys.dm_tran_database_transactions.database_transaction_begin_time of the session's transactions (sys.dm_tran_session_transactions)
ms_since_tran_begin_timebigintnullThe poll time minus tran_begin_time
tran_name_idintnull→ ref_valuesys.dm_tran_active_transactions.name of the session's earliest user transaction; dictionary attribute 19 (tran_name)
is_implicit_transmallintnull1 when that transaction is named implicit_transaction
resource_type_idintnull→ ref_valueParsed from sys.dm_os_waiting_tasks.resource_description, else from sys.dm_exec_requests.wait_resource; dictionary attribute 20 (resource_type)resource_type_id
resource_subtype_idintnull→ ref_valueParsed from sys.dm_os_waiting_tasks.resource_description, else from sys.dm_exec_requests.wait_resource; dictionary attribute 21 (resource_subtype)
resource_descr_idintnull→ ref_valuesys.dm_os_waiting_tasks.resource_description; dictionary attribute 22 (resource_description)
resource_associated_entity_idbigintnullThe object, HoBT or allocation unit id parsed from the wait resource
resource_lock_partitionintnullThe lock partition parsed from the wait resource
statement_start_offsetintnullsys.dm_exec_requests.statement_start_offset
statement_end_offsetintnullsys.dm_exec_requests.statement_end_offset
query_hashbinary(8)nullsys.dm_exec_requests.query_hash
query_plan_hashbinary(8)nullsys.dm_exec_requests.query_plan_hash
host_name_idintnull→ ref_valuesys.dm_exec_sessions.host_name; dictionary attribute 23 (host_name)host_name_id
program_name_idintnull→ ref_valuesys.dm_exec_sessions.program_name, with the name of a SQL Agent job in place of its id (SQLAgent - TSQL JobStep (Job name : Step n)) where msdb can be read; dictionary attribute 24 (program_name)program_name_id
host_process_idintnullsys.dm_exec_sessions.host_process_id
client_versionbigintnullsys.dm_exec_sessions.client_version
client_interface_idintnull→ ref_valuesys.dm_exec_sessions.client_interface_name; dictionary attribute 25 (client_interface_name)
login_name_idintnull→ ref_valuesys.dm_exec_sessions.login_name; dictionary attribute 26 (login_name)login_name_id
tran_isolation_levelsmallintnullsys.dm_exec_sessions.transaction_isolation_level
lock_timeoutintnullsys.dm_exec_sessions.lock_timeout
deadlock_priorityintnullsys.dm_exec_sessions.deadlock_priority
net_transport_idintnull→ ref_valuesys.dm_exec_connections.net_transport; dictionary attribute 27 (net_transport)
protocol_type_idintnull→ ref_valuesys.dm_exec_connections.protocol_type; dictionary attribute 28 (protocol_type)
protocol_versionintnullsys.dm_exec_connections.protocol_version
encrypt_option_idintnull→ ref_valuesys.dm_exec_connections.encrypt_option; dictionary attribute 29 (encrypt_option)
auth_scheme_idintnull→ ref_valuesys.dm_exec_connections.auth_scheme; dictionary attribute 30 (auth_scheme)
node_affinitysmallintnullsys.dm_exec_connections.node_affinity
conn_packet_readsbigintnullsys.dm_exec_connections.num_reads
conn_packet_writesbigintnullsys.dm_exec_connections.num_writes
conn_last_readdatetimenullsys.dm_exec_connections.last_read
conn_last_writedatetimenullsys.dm_exec_connections.last_write
net_packet_sizeintnullsys.dm_exec_connections.net_packet_size
client_net_addr_idintnull→ ref_valuesys.dm_exec_connections.client_net_address; dictionary attribute 31 (client_net_address)
client_tcp_portintnullsys.dm_exec_connections.client_tcp_port
local_net_addr_idintnull→ ref_valuesys.dm_exec_connections.local_net_address; dictionary attribute 32 (local_net_address)
local_tcp_portintnullsys.dm_exec_connections.local_tcp_port
sql_handlevarbinary(64)nullsys.dm_exec_requests.sql_handle (sys.dm_exec_connections.most_recent_sql_handle when the session has no request)
secs_since_last_req_endbigintnullThe poll time minus last_req_end_time
isdbccpagesmallintnullHow a page resource was resolved: 1 DBCC PAGE, 2 sys.dm_db_page_info
waittypebinary(2)nullsys.sysprocesses.waittype
qplan_keychar(18)null0x and the hexadecimal form of sys.dm_exec_requests.query_plan_hash
plan_handlevarbinary(64)nullsys.dm_exec_requests.plan_handle
percent_completedecimal(5,2)nullsys.dm_exec_requests.percent_complete
est_completion_timebigintnullsys.dm_exec_requests.estimated_completion_time
passchar(2)nullThe pass of the poll in which a lookup for the row failed
error_numberintnullerror_number() of that failure
error_message_idintnull→ ref_valueerror_message() of that failure; dictionary attribute 33 (error_message)
sqltextidintnull→ ref_sqltextThe template (SqlBLT.ref_sqltext) of the text from sys.dm_exec_sql_text or sys.dm_exec_input_buffer, parsed by SqlBLT.fnParseSQLsqltextid
qplanidintnull→ ref_qplanThe template (SqlBLT.ref_qplan) of the plan from sys.dm_exec_text_query_plan, parsed by SqlBLT.fnParseQPlan; or the template already known for the query_plan_hashqplanid
req_wait_ms_incbigintnullThe growth of wait_time_ms since the request's previous sample (SqlBLT.request_state), within the poll's windowwait_ms
req_cpu_ms_incbigintnullThe growth of req_cpu_ms since the request's previous sample (SqlBLT.request_state), within the poll's windowcpu_ms
req_logical_reads_incbigintnullThe growth of req_logical_reads since the request's previous sample (SqlBLT.request_state), within the poll's windowlogical_reads
req_phys_reads_incbigintnullThe growth of req_phys_reads since the request's previous sample (SqlBLT.request_state), within the poll's windowphysical_reads
req_writes_incbigintnullThe growth of req_writes since the request's previous sample (SqlBLT.request_state), within the poll's windowwrites
stmt_wait_ms_incbigintnullThe growth of the wait within the statement, in the poll's window; null on the statement's first samplestmt_wait_ms
stmt_cpu_ms_incbigintnullThe growth of the CPU time within the statement, in the poll's window; null on the statement's first samplestmt_cpu_ms
stmt_logical_reads_incbigintnullThe growth of the logical reads within the statement, in the poll's window; null on the statement's first samplestmt_logical_reads
stmt_phys_reads_incbigintnullThe growth of the physical reads within the statement, in the poll's window; null on the statement's first samplestmt_physical_reads
stmt_writes_incbigintnullThe growth of the writes within the statement, in the poll's window; null on the statement's first samplestmt_writes
child_wait_msbigintnullThe sum of wait_time_ms of the requests the session blocks, directly or through other blocked requestschild_wait_ms_max
child_wait_ms_incbigintnullThe same sum over req_wait_ms_incchild_wait_ms
qplan_att_idintnull→ ref_qplan_attributeThe attributes (SqlBLT.ref_qplan_attribute) of the plan from sys.dm_exec_text_query_plan: its warnings, plan guide and reasons; null with QPlanLogAttributes = 0
qplan_time_idintnull→ ref_qplan_timeThe compile values (SqlBLT.ref_qplan_time) of that plan; null with QPlanLogAttributes = 0

SqlBLT.request_state

The last sample of each request that SqlBLT.Collect has stored: its cumulative CPU time, reads and writes, its wait and its statement. At the next poll SqlBLT.Collect subtracts them from the request's new values, which gives the increments stored in SqlBLT.session_base. Rows not sampled for a day are deleted at the first poll of each hour.

Rows
One row per request (session_id, last_req_start).
Written by
SqlBLT.Collect
Primary key
session_id, last_req_start, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
session_idsmallintnot nullPKWith last_req_start: the request key
last_req_startdatetimenot nullPKThe start time of the request (sys.dm_exec_sessions.last_request_start_time)
req_cpu_msbigintnot nullThe request's last known sample (SqlBLT.Collect), for the next poll's increments
req_logical_readsbigintnot nullIts logical reads at that sample
req_phys_readsbigintnot nullIts physical reads at that sample
req_writesbigintnot nullIts writes at that sample
wait_time_msbigintnot nullIts wait time at that sample
wait_typenvarchar(256)nullIts wait type at that sample
sql_handlevarbinary(64)nullWith the offsets: the statement of the sample
stmt_start_offsetintnullThe start of the statement in its batch
stmt_end_offsetintnullThe end of the statement in its batch
last_nowdatetimenot nullThe poll of the sample; rows a day older than a poll go, at the first poll of each hour

3.2 Dictionaries and templates

Each name or value once (database, host, login, program, wait type, resource and others), referred to by id; each statement text and each query plan once, as a de-parameterised template; each request once; the number of references that the rows hold to each text, plan and value; the missing index recommendations of SQL Server for the queries of the requests captured.

SqlBLT.ref_type

The attributes whose values SqlBLT.ref_value holds.

Rows
One row per dictionary attribute: 33 rows.
Written by
The install script
Primary key
bpat_id, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
bpat_idsmallintnot nullPKThe attribute: 1 to 33
bpat_attributenvarchar(128)not nullIts name: the column of the view SqlBLT.sessions that shows the value

SqlBLT.ref_value

The dictionary. A name or value that recurs in the captured rows (a database, host, login or program name, a wait type, a resource description and others) is stored once; SqlBLT.session_base and the aggregate tables hold its bpat_value_id.

Rows
One row per distinct value of an attribute.
Written by
SqlBLT.Collect, through the trigger of SqlBLT.sessions
Primary key
bpat_value_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_value: unique, on bpat_id, bpat_value_hash
Checks
ck_ref_value_none: bpat_value_id = -1 or (bpat_id is not null and bpat_value_hash is not null and bpat_value is not null)
ColumnTypeNullableKeyDefinition
bpat_value_idintnot null identityPKThe id of the value
bpat_idsmallintnull→ ref_typeThe attribute the value belongs to
bpat_value_hashbinary(16)nullhashbytes('MD5', bpat_value)
bpat_valuenvarchar(3072)nullThe value

SqlBLT.ref_sqltext

The statement texts. With the setting ParseSqlText = 1, as installed, a captured text is de-parameterised by the SQL parser, which replaces its literals by ?, so texts that differ only in their literals share one row, their template; with 0 the parser is not run and every distinct text is a row of its own. The template is stored compressed (COMPRESS). With the setting StoreSqlTextSample = 1 the text as captured is stored too: for a template, the first original text that produced it.

Rows
One row per distinct text template; with the setting ParseSqlText = 0, one row per distinct text as captured.
Written by
SqlBLT.Collect
Primary key
sqltextid, clustered
Storage
Not partitioned.
Indexes
ux_ref_sqltext: unique, on sqltext_chash
Checks
ck_ref_sqltext_none: sqltextid = -1 or sqltext_chash is not null
ColumnTypeNullableKeyDefinition
sqltextidintnot null identityPKThe id of the statement
sqltext_chashvarchar(88)nullHash of the template, or of the text as captured when @ParseSqlText = 0; null in the row of the key -1 alone
sqltext_parsedvarbinary(max)nullCOMPRESS of the template (the text the SQL parser returns); null when @ParseSqlText = 0
sqltext_unparsedvarbinary(max)nullCOMPRESS of the text as captured: with @ParseSqlText = 1 the first original text that produced the template row; null when @StoreSqlTextSample = 0
sqltextleadingnvarchar(2048)nullFirst 2,048 characters of the template, or of the text as captured when @ParseSqlText = 0; null when neither is stored

SqlBLT.ref_sqltext_key

Maps the hash of a text as fetched to its template, so that a text seen before is not parsed again.

Rows
One row per distinct text as fetched.
Written by
SqlBLT.Collect
Primary key
sqltext_chash, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
sqltext_chashvarchar(88)not nullPKHash of the raw text as fetched
sqltextidintnot null→ ref_sqltextref_sqltext.sqltextid of its template

SqlBLT.ref_qplan

The query plans. With the setting ParseQPlans = 1, as installed, a captured plan (showplan XML) is parsed into its template: its literals and generated names are masked, the compile, statistics, memory and hardware detail removed and the estimates set to 0, while the shape and the operators are kept; with 0 the parser is not run and every distinct plan fetched is a row of its own. With the setting QPlanSkipStorageOfKnownHashes = 1 a plan is not parsed or stored again when its query_plan_hash already has one (SqlBLT.ref_qplan_hash). The template is stored compressed (COMPRESS). With the setting StoreQPlanSample = 1 the plan as captured is stored too: for a template, the first raw plan that produced it.

Rows
One row per distinct plan template; with the setting ParseQPlans = 0, one row per distinct plan fetched.
Written by
SqlBLT.Collect
Primary key
qplanid, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan: unique, on qplan_chash
Checks
ck_ref_qplan_none: qplanid = -1 or qplan_chash is not null
ColumnTypeNullableKeyDefinition
qplanidintnot null identityPKThe id of the plan
qplan_chashvarchar(88)nullHash of the plan template, or of the plan as captured when @ParseQPlans = 0; null in the row of the key -1 alone
qplan_parsedvarbinary(max)nullCOMPRESS of the template (the text the plan parser returns); null when @ParseQPlans = 0
qplan_unparsedvarbinary(max)nullCOMPRESS of the plan as captured: with @ParseQPlans = 1 the first raw plan that produced the template row; null when @StoreQPlanSample = 0

SqlBLT.ref_qplan_key

Maps the hash of a plan as fetched to its template, so that a plan seen before is not parsed again.

Rows
One row per distinct plan as fetched.
Written by
SqlBLT.Collect
Primary key
qplan_chash, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
qplan_chashvarchar(88)not nullPKHash of the raw plan as fetched
qplanidintnot null→ ref_qplanref_qplan.qplanid of its template

SqlBLT.ref_qplan_hash

Maps the engine's query_plan_hash of a statement to the first template stored for it. With the setting QPlanSkipStorageOfKnownHashes = 1 the plan of a statement whose query_plan_hash is here is not parsed or stored again.

Rows
One row per query_plan_hash.
Written by
SqlBLT.Collect
Primary key
query_plan_hash, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
query_plan_hashbinary(8)not nullPKThe engine's query_plan_hash of a statement whose plan has been templated
qplanidintnot null→ ref_qplanref_qplan.qplanid of the first template seen for it

SqlBLT.ref_request

The requests that SqlBLT.Aggregate has read, each with its first and last poll and its statement at those polls. request_id is the key of the request dimension of the aggregate tables.

Rows
One row per request (session_id, last_req_start).
Written by
SqlBLT.Aggregate
Primary key
request_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_request: unique, on session_id, last_req_start
Checks
ck_ref_request_none: request_id = -1 or (session_id is not null and first_now is not null and last_now is not null)
ColumnTypeNullableKeyDefinition
request_idintnot null identityPKThe request dimension's key (bit 1024)
session_idsmallintnullWith last_req_start: the request as SQL Server reports it; null in the row of the key -1 alone
last_req_startdatetimenullThe start time of the request (SqlBLT.session_base.last_req_start_time)
first_nowdatetimenullThe first poll that captured it
last_nowdatetimenullThe last poll that captured it
sqltextid_firstintnull→ ref_sqltextIts statement at the first poll
sqltextid_lastintnull→ ref_sqltextIts statement at the last poll
qplanid_lastintnull→ ref_qplanIts plan at the last poll

SqlBLT.ref_counts

The reference counts of the statement texts, the query plans and the dictionary values: how many references the rows of SqlBLT.session_base, agg_second, agg_minute, agg_hour and agg_day hold to one row of SqlBLT.ref_sqltext, SqlBLT.ref_qplan or SqlBLT.ref_value. objid and ref_objid are SqlBLT.size_object.objid. A count is added in the transaction that inserts the rows and taken off by SqlBLT.MaintainPartitions when it truncates a partition; a count that reaches 0 loses its row. A text or plan without a row here is referenced by no row, and SqlBLT.MaintainPartitions deletes it. The counts are rebuilt from the rows on the days that the settings RebuildRefCountsDayOfMonth and RebuildRefCountsDayOfWeek name.

Rows
One row per referencing table (objid), referenced table (ref_objid) and referenced row (ref_id).
Written by
SqlBLT.Collect (through the trigger of SqlBLT.sessions), SqlBLT.Aggregate and SqlBLT.MaintainPartitions
Primary key
objid, ref_objid, ref_id, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
objidsmallintnot nullPK → size_objectsize_object.objid: the table that holds the references
ref_objidsmallintnot nullPK → size_objectsize_object.objid: the table referenced: ref_sqltext, ref_qplan or ref_value
ref_idintnot nullPKThe row referenced: its sqltextid, qplanid or bpat_value_id
ref_countbigintnot nullThe number of references

SqlBLT.ref_missing_index

The missing index recommendations of SQL Server for the queries of the requests captured (setting CaptureMissingIndexes = 1): the table of the index and its equality, inequality and included columns, as SQL Server names them. missing_index_hash, over the table and the three column lists, keeps each index once. SqlBLT.MaintainPartitions deletes an index that no row of SqlBLT.ref_query_missing_index names any more.

Rows
One row per index that SQL Server recommends.
Written by
SqlBLT.Collect
Primary key
missing_index_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_missing_index: unique, on missing_index_hash
ColumnTypeNullableKeyDefinition
missing_index_idintnot null identityPKThe id of the index recommended
missing_index_hashbinary(16)not nullhashbytes('MD5') of the table's three-part name and the three column lists: the row's natural key
dbnamenvarchar(128)nullThe table's database
schnamenvarchar(128)nullIts schema
objnamenvarchar(128)nullThe table
equality_columnsnvarchar(4000)nullThe columns compared for equality, as sys.dm_db_missing_index_details lists them: [a], [b]
inequality_columnsnvarchar(4000)nullThe columns of the other comparisons, listed likewise
included_columnsnvarchar(4000)nullThe columns to include, listed likewise

SqlBLT.ref_query_missing_index

Which index SQL Server recommends for which query of the requests captured, with the first and the last poll at which the recommendation was found; a row is written at most once a minute. On SQL Server 2019 and later the recommendations are read from sys.dm_db_missing_index_group_stats_query at every poll, with avg_user_impact, user_seeks, user_scans and avg_total_user_cost as last read, and group_handle finds the row of a recommendation again while the instance runs, so that its index is read from sys.dm_db_missing_index_details once; before it they are read from the MissingIndexes element of each plan a poll fetches, with the Impact of the plan as avg_user_impact, and last_seen follows the polls at which a request has the query. The rows of a statement text are deleted with the text by SqlBLT.MaintainPartitions.

Rows
One row per statement text, query (query_hash, query_plan_hash) and index recommended for it.
Written by
SqlBLT.Collect
Primary key
sqltextid, query_hash, query_plan_hash, missing_index_id, clustered
Storage
Not partitioned.
Indexes
ix_ref_query_missing_index: on missing_index_id
ColumnTypeNullableKeyDefinition
sqltextidintnot nullPK → ref_sqltextref_sqltext.sqltextid: the statement text of the requests
query_hashbinary(8)not nullPKThe engine's query_hash of the requests
query_plan_hashbinary(8)not nullPKThe engine's query_plan_hash of the requests
missing_index_idintnot nullPK → ref_missing_indexref_missing_index.missing_index_id: the index recommended
first_seendatetimenot nullThe first poll at which the recommendation was found for a request captured
last_seendatetimenot nullThe last poll at which it was found; written at most once a minute
avg_user_impactfloatnullpercent: the view's avg_user_impact as last read; without the view the Impact of the plan's MissingIndexGroup
user_seeksbigintnullThe view's user_seeks as last read; null without the view
user_scansbigintnullThe view's user_scans as last read; null without the view
avg_total_user_costfloatnullThe view's avg_total_user_cost as last read; null without the view
group_handleintnullThe view's group_handle of the recommendation: it identifies the recommendation while the instance runs, so a row seen since the instance started is found again by it; null without the view

3.3 Query plan attributes

What the plan of a request carries besides its shape: the warnings of the query optimizer with the columns, conversions and indexes they name, the plan guide, the reasons and the compile values; each text value once.

SqlBLT.ref_qplan_value

A text value of the plan attributes that repeats, stored once: the name of a database, a schema, a table or a plan guide, a reason, a conversion issue, a data type. The other tables hold its qplan_value_id. SqlBLT.MaintainPartitions deletes a value that no row names any more.

Rows
One row per text value.
Written by
SqlBLT.Collect
Primary key
qplan_value_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_value: unique, on qplan_value
ColumnTypeNullableKeyDefinition
qplan_value_idintnot null identityPKThe id of the text value
qplan_valuenvarchar(128)not nullThe text, as SQL Server gives it

SqlBLT.ref_qplan_attribute

The attributes of a query plan other than its shape (setting QPlanLogAttributes = 1): UsePlan, the plan guide, NonParallelPlanReason, CardinalityEstimationModelVersion, StatementOptmEarlyAbortReason, the number of joins without a join predicate, and three lists. att_hash finds a combination again. A row of SqlBLT.session_base names its combination (qplan_att_id).

Rows
One row per plan and combination of attributes.
Written by
SqlBLT.Collect
Primary key
qplan_att_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_attribute: unique, on qplanid, att_hash
ColumnTypeNullableKeyDefinition
qplan_att_idintnot null identityPKThe id of the combination
qplanidintnot null→ ref_qplanref_qplan.qplanid: the plan
att_hashbinary(16)not nullhashbytes('MD5') of the columns below and of the ids of the three lists: finds a combination again; it holds no data of its own
use_planbitnullUsePlan: 1 = the plan is forced (a USE PLAN hint, a plan guide or Query Store)
ce_model_versionsmallintnullCardinalityEstimationModelVersion: 70 = the legacy cardinality estimator
no_join_predicatessmallintnot nullThe joins of the plan without a join predicate (the warning NoJoinPredicate)
plan_guide_db_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: PlanGuideDB, the database of the plan guide applied
plan_guide_name_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: PlanGuideName, the plan guide applied
non_parallel_plan_reason_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: NonParallelPlanReason, why the plan is serial, as SQL Server states it
optm_early_abort_reason_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: StatementOptmEarlyAbortReason: TimeOut, MemoryLimitExceeded or GoodEnoughPlanFound

SqlBLT.ref_qplan_time

The values of a plan that differ from one compilation to the next: CompileTime, CompileCPU, CompileMemory and the SerialDesiredMemory of the memory grant. A row of SqlBLT.session_base names its set (qplan_time_id).

Rows
One row per plan and set of compile values.
Written by
SqlBLT.Collect
Primary key
qplan_time_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_time: unique, on qplanid, compile_ms, compile_cpu_ms, compile_memory_kb, serial_desired_memory_kb
ColumnTypeNullableKeyDefinition
qplan_time_idintnot null identityPKThe id of the set of compile values
qplanidintnot null→ ref_qplanref_qplan.qplanid: the plan
compile_msintnullCompileTime: milliseconds
compile_cpu_msintnullCompileCPU: milliseconds
compile_memory_kbintnullCompileMemory: KB
serial_desired_memory_kbbigintnullSerialDesiredMemory of the memory grant: KB
last_seendatetimenot nullThe last poll at which a request captured had these values; written at most once a minute

SqlBLT.ref_qplan_column

A column named by ColumnsWithNoStatistics or converted by a PlanAffectingConvert, stored once whichever warning names it.

Rows
One row per column that a warning names.
Written by
SqlBLT.Collect
Primary key
qplan_column_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_column: unique, on dbname_id, schname_id, objname_id, colname
ColumnTypeNullableKeyDefinition
qplan_column_idintnot null identityPKThe id of the column
colnamenvarchar(128)not nullThe column
dbname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: the column's database; null where the plan names none
schname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: its schema
objname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: its table or view

SqlBLT.ref_qplan_index

A filtered index that a parameterised statement cannot use (UnmatchedIndexes).

Rows
One row per index that a warning names.
Written by
SqlBLT.Collect
Primary key
qplan_index_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_index: unique, on dbname_id, schname_id, objname_id, indexname
ColumnTypeNullableKeyDefinition
qplan_index_idintnot null identityPKThe id of the index
indexnamenvarchar(128)not nullThe index
dbname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: the index's database
schname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: its schema
objname_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: its table or view

SqlBLT.ref_qplan_convert

A PlanAffectingConvert warning: its issue (Seek Plan or Cardinality Estimate), the data type converted to, the column converted and the expression, its literals masked.

Rows
One row per conversion that affects a plan.
Written by
SqlBLT.Collect
Primary key
qplan_convert_id, clustered
Storage
Not partitioned.
Indexes
ux_ref_qplan_convert: unique, on convert_issue_id, qplan_column_id, to_type_id, expression
ColumnTypeNullableKeyDefinition
qplan_convert_idintnot null identityPKThe id of the conversion
qplan_column_idintnull→ ref_qplan_columnref_qplan_column.qplan_column_id: the column converted; null where the expression converts no column
expressionnvarchar(400)not nullExpression: the conversion as SQL Server states it, its literals masked by the SQL parser; the first 400 characters
convert_issue_idintnot null→ ref_qplan_valueref_qplan_value.qplan_value_id: ConvertIssue: Seek Plan (the conversion prevented an index seek) or Cardinality Estimate
to_type_idintnull→ ref_qplan_valueref_qplan_value.qplan_value_id: the data type converted to

SqlBLT.ref_qplan_att_no_statistics

The list ColumnsWithNoStatistics of a combination of attributes.

Rows
One row per combination and column without statistics.
Written by
SqlBLT.Collect
Primary key
qplan_att_id, qplan_column_id, clustered
Storage
Not partitioned.
Indexes
ix_ref_qplan_att_no_statistics: on qplan_column_id
ColumnTypeNullableKeyDefinition
qplan_att_idintnot nullPK → ref_qplan_attributeref_qplan_attribute.qplan_att_id
qplan_column_idintnot nullPK → ref_qplan_columnref_qplan_column.qplan_column_id: a column without statistics

SqlBLT.ref_qplan_att_convert

The list PlanAffectingConvert of a combination of attributes.

Rows
One row per combination and conversion.
Written by
SqlBLT.Collect
Primary key
qplan_att_id, qplan_convert_id, clustered
Storage
Not partitioned.
Indexes
ix_ref_qplan_att_convert: on qplan_convert_id
ColumnTypeNullableKeyDefinition
qplan_att_idintnot nullPK → ref_qplan_attributeref_qplan_attribute.qplan_att_id
qplan_convert_idintnot nullPK → ref_qplan_convertref_qplan_convert.qplan_convert_id: a conversion that affects the plan

SqlBLT.ref_qplan_att_unmatched_index

The list UnmatchedIndexes of a combination of attributes.

Rows
One row per combination and unmatched index.
Written by
SqlBLT.Collect
Primary key
qplan_att_id, qplan_index_id, clustered
Storage
Not partitioned.
Indexes
ix_ref_qplan_att_unmatched_index: on qplan_index_id
ColumnTypeNullableKeyDefinition
qplan_att_idintnot nullPK → ref_qplan_attributeref_qplan_attribute.qplan_att_id
qplan_index_idintnot nullPK → ref_qplan_indexref_qplan_index.qplan_index_id: a filtered index the statement cannot use

SqlBLT.ref_query_qplan_attribute

Which statement text had which combination, with the first and the last poll at which a request captured had it. The reports find the warnings of a statement through it.

Rows
One row per statement text and combination of attributes.
Written by
SqlBLT.Collect
Primary key
sqltextid, qplan_att_id, clustered
Storage
Not partitioned.
Indexes
ix_ref_query_qplan_attribute: on qplan_att_id
ColumnTypeNullableKeyDefinition
sqltextidintnot nullPK → ref_sqltextref_sqltext.sqltextid: the statement text of the requests
qplan_att_idintnot nullPK → ref_qplan_attributeref_qplan_attribute.qplan_att_id: the combination their plan had
first_seendatetimenot nullThe first poll at which a request captured had the text with the combination
last_seendatetimenot nullThe last poll at which one had; written at most once a minute

3.4 Aggregates

Samples, sums and maxima of the captured rows per second, minute, hour and day, for each enabled set of dimensions.

SqlBLT.agg_second, SqlBLT.agg_minute, SqlBLT.agg_hour, SqlBLT.agg_day

The aggregates of the captured rows at four grains: the second, the minute, the hour and the day of the poll. For each enabled set of SqlBLT.agg_set, SqlBLT.Aggregate groups the rows of SqlBLT.session_base by the set's dimensions and stores the number of samples and the sums and maxima of wait, elapsed time, CPU time, reads, writes and child waits. A key column of a dimension the set lacks holds -1 (blt holds '-'). The four tables have the same columns.

Rows
One row per bucket of time, set and key of the set's dimensions.
Written by
SqlBLT.Aggregate
Primary key
set_id, agg_time, blt, database_id, wait_dbname_id, wait_schname_id, wait_objname_id, program_name_id, sqltextid, host_name_id, login_name_id, wait_type_id, qplanid, resource_type_id, request_id, clustered
Storage
agg_second: partitioned by agg_time on scheme psSqlBLTSecond (function pfSqlBLTSecond): a boundary per day, 14 partitions retained as installed
agg_minute: partitioned by agg_time on scheme psSqlBLTMinute (function pfSqlBLTMinute): a boundary per day, 90 partitions retained as installed
agg_hour: partitioned by agg_time on scheme psSqlBLTHour (function pfSqlBLTHour): a boundary per day, 183 partitions retained as installed
agg_day: partitioned by agg_time on scheme psSqlBLTDay (function pfSqlBLTDay): a boundary per day, 365 partitions retained as installed
Page compression.
ColumnTypeNullableKeyDefinition
agg_timedatetimenot nullPKThe second, minute, hour or day the row covers: the poll times truncated to it; partitioning column
set_idsmallintnot nullPK → agg_setagg_set.set_id
database_idintnot null default -1PK → ref_valueDimension database (bit 1): the session's database; from session_base.conn_db_id; -1 when the set lacks the dimension
wait_dbname_idintnot null default -1PK → ref_valueDimension object (bit 2): the waited resource's database, schema and object; from session_base.wait_dbname_id; -1 when the set lacks the dimension
wait_schname_idintnot null default -1PK → ref_valueDimension object (bit 2): the waited resource's database, schema and object; from session_base.wait_schname_id; -1 when the set lacks the dimension
wait_objname_idintnot null default -1PK → ref_valueDimension object (bit 2): the waited resource's database, schema and object; from session_base.wait_objname_id; -1 when the set lacks the dimension
program_name_idintnot null default -1PK → ref_valueDimension application (bit 4): program_name of the session; from session_base.program_name_id; -1 when the set lacks the dimension
sqltextidintnot null default -1PK → ref_sqltextDimension query (bit 8): the text template of the statement; from session_base.sqltextid; -1 when the set lacks the dimension
host_name_idintnot null default -1PK → ref_valueDimension host (bit 16): host_name of the session; from session_base.host_name_id; -1 when the set lacks the dimension
login_name_idintnot null default -1PK → ref_valueDimension login (bit 32): login_name of the session; from session_base.login_name_id; -1 when the set lacks the dimension
wait_type_idintnot null default -1PK → ref_valueDimension wait type (bit 64): wait_type of the request; from session_base.wait_type_id; -1 when the set lacks the dimension
qplanidintnot null default -1PK → ref_qplanDimension plan (bit 128): the plan template of the statement; from session_base.qplanid; -1 when the set lacks the dimension
bltchar(1)not null default '-'PKDimension BLT (bit 256): the row's role at the poll: B blocked, T head blocker, L long running; from session_base.BLT; '-' when the set lacks the dimension
resource_type_idintnot null default -1PK → ref_valueDimension resource type (bit 512): resource_type of the request's wait; from session_base.resource_type_id; -1 when the set lacks the dimension
request_idintnot null default -1PK → ref_requestDimension request (bit 1024): the request: its session and start time (SqlBLT.ref_request); from session_base.session_id, last_req_start_time; -1 when the set lacks the dimension
samplesintnot null default 0rows: B, T and L
polls_presentintnot null default 0Polls of the row's agg_time interval in which the group had a row
sessions_maxintnot null default 0The most rows of the group in one poll
session_secondsbigintnot null default 0Sum of the poll gaps of the rows, in seconds
wait_msbigintnot null default 0Sum of req_wait_ms_inc: the requests' wait in the poll windows
wait_ms_maxbigintnot null default 0The largest wait_time_ms sampled
elapsed_ms_maxbigintnot null default 0The largest elapsed_ms sampled
cpu_msbigintnot null default 0Sum of req_cpu_ms_inc
logical_readsbigintnot null default 0Sum of req_logical_reads_inc
physical_readsbigintnot null default 0Sum of req_phys_reads_inc
writesbigintnot null default 0Sum of req_writes_inc
child_wait_msbigintnot null default 0Sum of child_wait_ms_inc: the wait of the requests blocked under the rows' sessions, in the poll windows
child_wait_ms_maxbigintnot null default 0The largest child_wait_ms sampled
stmt_wait_msbigintnullSum of stmt_wait_ms_inc; a statement sum is null while no row has added to it
stmt_cpu_msbigintnullSum of stmt_cpu_ms_inc (first samples by SqlBLT.Aggregate @StatementFirstSampleNull)
stmt_logical_readsbigintnullSum of stmt_logical_reads_inc (likewise)
stmt_physical_readsbigintnullSum of stmt_phys_reads_inc (likewise)
stmt_writesbigintnullSum of stmt_writes_inc (likewise)

SqlBLT.agg_set

The sets of dimensions that are aggregated, and the grains each set is stored at. set_id is the sum of the bits of the set's dimensions. A set with enabled = 0 is not computed from the next batch on.

Rows
One row per set: 15 rows as installed.
Written by
The install script; a DBA may add or disable sets
Primary key
set_id, clustered
Storage
Not partitioned.
Checks
ck_agg_set_bits: set_id = has_database * 1 + has_object * 2 + has_application * 4 + has_query * 8 + has_host * 16 + has_login * 32 + has_wait_type * 64 + has_plan * 128 + has_blt * 256 + has_resource_type * 512 + has_request * 1024
ColumnTypeNullableKeyDefinition
set_idsmallintnot nullPKThe sum of the bits of the set's dimensions
namevarchar(60)not nullThe name of the set
has_databasebitnot null1 = the set has the dimension database (bit 1)
has_objectbitnot null1 = the set has the dimension object (bit 2)
has_applicationbitnot null1 = the set has the dimension application (bit 4)
has_querybitnot null1 = the set has the dimension query (bit 8)
has_hostbitnot null1 = the set has the dimension host (bit 16)
has_loginbitnot null1 = the set has the dimension login (bit 32)
has_wait_typebitnot null1 = the set has the dimension wait type (bit 64)
has_planbitnot null1 = the set has the dimension plan (bit 128)
has_bltbitnot null1 = the set has the dimension BLT (bit 256)
has_resource_typebitnot null1 = the set has the dimension resource type (bit 512)
has_requestbitnot null1 = the set has the dimension request (bit 1024)
at_secondbitnot null1 = the set is stored in SqlBLT.agg_second
at_minutebitnot null1 = the set is stored in SqlBLT.agg_minute
at_hourbitnot null1 = the set is stored in SqlBLT.agg_hour
at_daybitnot null1 = the set is stored in SqlBLT.agg_day
enabledbitnot null0 = not computed from the next batch on
descriptionvarchar(200)not null default ''A note on the set

SqlBLT.agg_dimension

The dimensions a set is made of: the key columns of each in the aggregate tables, its source columns in SqlBLT.session_base and the table that renders a key.

Rows
One row per dimension: 11 rows.
Written by
The install script
Primary key
bit, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
bitsmallintnot nullPKThe dimension's bit; a set's set_id is the sum of the bits of its dimensions
namevarchar(20)not nullThe name of the dimension
key_columnsvarchar(60)not nullThe key column(s) in the aggregate tables
source_columnsvarchar(60)not nullIn SqlBLT.session_base
ref_tablevarchar(20)not nullWhere a key is rendered: ref_value, ref_sqltext or ref_qplan
ref_attributesvarchar(20)not nullref_type.bpat_id of the dictionary attribute(s); '' for a store table
descriptionvarchar(200)not nullWhat the dimension is

3.5 Metrics

The 115 metrics of metric, sampled at every run and aggregated per minute, hour and day.

SqlBLT.metric

The metrics that SqlBLT.CollectMetrics collects and the reports show: a wait type group, a performance counter, CPU, the schedulers, memory, sessions and requests, tempdb space or file IO per database. kind says how a value is stored: G a gauge as sampled, D the growth of a cumulative value since the previous run, A the growth of a value over the growth of its base.

Rows
One row per metric: 115 rows as installed.
Written by
The install script; a DBA may add or disable metrics
Primary key
metric_id, clustered
Storage
Not partitioned.
Checks
ck_metric_kind: kind in ('G', 'D', 'A')
ck_metric_source: source in ('W', 'X', 'C', 'R', 'A', 'S', 'M', 'Q', 'T', 'F')
ColumnTypeNullableKeyDefinition
metric_idsmallintnot nullPKThe id of the metric
namenvarchar(128)not nullAs the reports show it
categoryvarchar(16)not nullwait, counter, cpu, scheduler, memory, session, tempdb, io
sourcechar(1)not nullW, X, C, R, A, S, M, Q, T, F (see above)
kindchar(1)not nullG gauge, D delta, A average
unitvarchar(16)not nullms, /s (a delta per second), count, %, KB, MB, pages, s
patternnvarchar(128)nullW: the LIKE pattern of the wait types summed
object_namenvarchar(128)nullC: the counter object after SQLServer: or MSSQL$name:
counter_namenvarchar(128)nullC: the counter
instance_namenvarchar(128)nullC: its instance ('' for none, _Total); null = every instance of the counter, summed
base_counternvarchar(128)nullC: the base counter of a ratio (G) or average (A)
per_databasebitnot null default 0F: one row per database, scope_id = database_id
enabledbitnot null default 1Collected
shownbitnot null default 0In the reports' default band
sort_ordersmallintnot null default 0Its place in the reports' list
descriptionnvarchar(400)not null default ''What the metric shows

SqlBLT.metric_base

The metric samples. A per-database metric (file IO) has one row per database, with scope_id the database_id; every other metric has scope_id 0.

Rows
One row per run, metric and scope.
Written by
SqlBLT.CollectMetrics
Primary key
now, metric_id, scope_id, clustered
Storage
Partitioned by now on scheme psSqlBLTMetric (function pfSqlBLTMetric): a boundary per day, 14 partitions retained as installed. Page compression.
ColumnTypeNullableKeyDefinition
nowdatetimenot nullPKThe run; partitioning column (psSqlBLTMetric)
metric_idsmallintnot nullPK → metricThe metric
scope_idintnot null default 0PK → metric_scope0, or the database_id of a per-database metric
valuefloatnot nullG: the value sampled; D: the growth over the interval; A: the average over the interval
secondsintnot null default 0D and A: the interval the value covers

SqlBLT.metric_minute, SqlBLT.metric_hour, SqlBLT.metric_day

The metric aggregates per minute, hour and day: the number of samples, their seconds, and the sum, minimum, maximum and last value. The rate of a D or A metric at a grain is value_sum / seconds; the average of a gauge is value_sum / samples. The three tables have the same columns.

Rows
One row per bucket of time, metric and scope.
Written by
SqlBLT.AggregateMetrics
Primary key
metric_id, scope_id, agg_time, clustered
Storage
metric_minute: partitioned by agg_time on scheme psSqlBLTMetricMinute (function pfSqlBLTMetricMinute): a boundary per day, 90 partitions retained as installed
metric_hour: partitioned by agg_time on scheme psSqlBLTMetricHour (function pfSqlBLTMetricHour): a boundary per day, 183 partitions retained as installed
metric_day: partitioned by agg_time on scheme psSqlBLTMetricDay (function pfSqlBLTMetricDay): a boundary per day, 365 partitions retained as installed
Page compression.
ColumnTypeNullableKeyDefinition
agg_timedatetimenot nullPKThe minute, hour or day the row covers; partitioning column
metric_idsmallintnot nullPK → metricThe metric
scope_idintnot nullPK → metric_scope0, or the database_id of a per-database metric
samplesintnot nullRows of metric_base
secondsintnot nullTheir intervals summed (D and A)
value_sumfloatnot nullSum of the values
value_minfloatnot nullThe smallest value
value_maxfloatnot nullThe largest value
value_lastfloatnot nullThe value of the latest run

SqlBLT.metric_scope

The databases of the per-database metrics, with their names, so that a restored copy still names them.

Rows
One row per database that a per-database metric has seen.
Written by
SqlBLT.CollectMetrics
Primary key
scope_id, clustered
Storage
Not partitioned.
Checks
ck_metric_scope_none: scope_id = 0 or (name is not null and first_seen is not null and last_seen is not null)
ColumnTypeNullableKeyDefinition
scope_idintnot nullPKThe database_id of a per-database metric; 0 = the instance: the scope of the other metrics
namesysnamenullIts name, kept so that a restored copy still names it; null in the row of scope 0 alone
first_seendatetimenullThe first run that saw the database
last_seendatetimenullThe last run that saw it

SqlBLT.metric_state

The cumulative values of the previous run, from which the next run computes the growth. The table is emptied when the instance has restarted or the previous run is older than the setting MaxIntervalSeconds, so that the next run stores no deltas.

Rows
One row per metric and scope that has a cumulative value, and the row (0, 0) of the run.
Written by
SqlBLT.CollectMetrics
Primary key
metric_id, scope_id, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
metric_idsmallintnot nullPK0 with scope 0: the previous run (sampled) and the instance start time (raw)
scope_idintnot nullPK0, or the database_id of a per-database metric
sampleddatetimenot nullTime of the sample
rawfloatnullThe cumulative value sampled
raw_basefloatnullThe base of that value, for an average

SqlBLT.metric_wait_skip

LIKE patterns of benign wait types, which are left out of the wait totals.

Rows
One row per pattern: 41 rows as installed.
Written by
The install script
Primary key
pattern, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
patternnvarchar(128)not nullPKA LIKE pattern of benign wait types, left out of the totals

SqlBLT.metric_agg_polls, SqlBLT.metric_agg_rows

Memory-optimized tables (durability SCHEMA_ONLY) in which SqlBLT.AggregateMetrics stages a batch when its setting InMemoryWorkTables is 1: SqlBLT.metric_agg_polls holds the runs of the batch, each with its three buckets and the run's interval, and SqlBLT.metric_agg_rows the aggregated rows. The procedure creates them when they are missing, which needs a MEMORY_OPTIMIZED_DATA filegroup; the install script does not create them. The next batch empties them.

Rows
Rows of the batch in progress only.
Written by
SqlBLT.AggregateMetrics
metric_agg_pollsTypeNullableKeyDefinition
polldatetimenot nullPKThe run
graintinyintnot nullPKThe grain of the bucket
agg_timedatetimenot nullThe bucket the run falls in
secondsintnot nullThe interval of the run
metric_agg_rowsTypeNullableKeyDefinition
graintinyintnot nullPKThe grain of the bucket
agg_timedatetimenot nullPKThe bucket
metric_idsmallintnot nullPKThe metric
scope_idintnot nullPK0, or the database_id of a per-database metric
samplesintnot nullRows of SqlBLT.metric_base
secondsintnot nullTheir intervals summed
value_sumfloatnot nullSum of the values
value_minfloatnot nullThe smallest value
value_maxfloatnot nullThe largest value
last_nowdatetimenot nullThe latest run of the bucket in the batch
value_lastfloatnullThe value of that run

3.6 Config

The settings of the procedures, the boundary period and the retention of each partition function, and the versions installed.

SqlBLT.config_setting

The settings of SqlBLT.Collect, SqlBLT.CollectMetrics, SqlBLT.Aggregate, SqlBLT.AggregateMetrics and SqlBLT.MaintainPartitions: one row per parameter of the procedure. A parameter that an execution does not pass takes the value of its row, read at the start of every execution, so a change applies from the next one; the job steps pass none. A parameter that is passed applies to that execution alone.

Rows
One row per setting: 30 rows.
Written by
The install script; a DBA sets the values
Primary key
procedure_name, setting_name, clustered
Storage
Not partitioned.
Checks
ck_config_setting_value: value between min_value and max_value
ColumnTypeNullableKeyDefinition
procedure_namesysnamenot nullPKCollect, CollectMetrics, Aggregate, AggregateMetrics or MaintainPartitions
setting_namesysnamenot nullPKThe procedure's parameter of this name, without the @
valuebigintnot nullWhat the procedure runs with when the parameter is not passed
min_valuebigintnot nullThe lowest and
max_valuebigintnot nullThe highest value the setting takes
descriptionnvarchar(400)not nullWhat the setting does

SqlBLT.config_partition

The boundary period, the number of future boundaries and the number of partitions retained of each partition function. SqlBLT.MaintainPartitions reads the table once a day, so a change takes effect at its next run; a change of boundary_period applies to the boundaries added from then on.

Rows
One row per partition function: 9 rows.
Written by
The install script; a DBA sets the values
Primary key
function_name, clustered
Storage
Not partitioned.
Checks
ck_config_partition_function: function_name in (N'pfSqlBLT', N'pfSqlBLTSecond', N'pfSqlBLTMinute', N'pfSqlBLTHour', N'pfSqlBLTDay', N'pfSqlBLTMetric', N'pfSqlBLTMetricMinute', N'pfSqlBLTMetricHour', N'pfSqlBLTMetricDay')
ck_config_partition_boundary_period: boundary_period in ('day', 'month', 'year')
ck_config_partition_future_boundaries: future_boundaries between 1 and 1000
ck_config_partition_partitions_retained: partitions_retained between 0 and 13000
ColumnTypeNullableKeyDefinition
function_namesysnamenot nullPKThe partition function
boundary_periodvarchar(5)not nullThe period from one boundary to the next: day, month or year
future_boundariesintnot nullThe number of boundaries kept ahead of now
partitions_retainedintnot nullThe number of partitions before the current one that keep their rows; 0 = every partition is kept

SqlBLT.config_version

The SqlBLT versions installed in the database: the installation and each upgrade. The latest row is the version that the procedures record in their log rows.

Rows
One row per version installed.
Written by
The install and upgrade scripts
Primary key
version, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
versionchar(13)not nullPKThe SqlBLT version installed; the latest by installed is what SqlBLT.Collect, Aggregate and MaintainPartitions record in their log rows
installeddatetimenot nullWhen it was installed, or upgraded to
upgraded_fromchar(13)nullThe version an upgrade replaced; null for a fresh installation

3.7 Logging

One row per poll, metrics run, aggregation batch and maintenance execution, with its timings and outcome; the errors.

SqlBLT.log_capture

The polls of SqlBLT.Collect. The row is written after the poll's SqlBLT.session_base rows, so a poll in this table is complete. It holds the number of rows, the duration, the time of each phase and the texts and plans fetched and parsed.

Rows
One row per poll.
Written by
SqlBLT.Collect
Primary key
now, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
nowdatetimenot nullPKTime of the poll: the now of its SqlBLT.session_base rows
versionchar(13)not nullThe SqlBLT version that ran the poll
rows_returnedintnot nullRows of the poll: B, T and L
duration_msintnot nullDuration of the poll
ms_classifyintnullClassification read (B, T, L rows)
ms_detailintnullDetail read of sessions, requests, connections
ms_resolveintnullResource parsing and catalog resolution
ms_cacheintnullText and plan fetches
ms_captureintnullincrements, insert into the capture view (trigger: dictionary values, key mapping, session_base rows), request state; without ms_missing_index and ms_qplan_attribute
cyclesintnullB rows that reach no head blocker (a blocking cycle), not reported as B rows
ms_text_fetchintnullText fetch and raw hashing (part of ms_cache)
ms_plan_fetchintnullPlan fetch and raw hashing (part of ms_cache)
plans_fetchedintnullDistinct (plan_handle, offsets) keys fetched
plans_skippedintnullDistinct keys not parsed or stored again: their query_plan_hash already has a template (@QPlanSkipStorageOfKnownHashes = 1); with @QPlanLogAttributes = 1 they are fetched all the same
texts_parsedintnullTexts passed through the SQL parser (raw hashes not seen before)
text_chars_parsedintnullTheir characters
ms_text_parseintnullTheir templating time
plans_parsedintnullPlans passed through the plan parser (raw hashes not seen before)
plan_chars_parsedintnullTheir characters
plan_chars_maxintnullThe largest of them
ms_plan_parseintnullTheir templating time, one plan at a time
ms_plan_parse_maxintnullThe slowest of them
ms_storeintnullTemplate hashing, compression and the ref_sqltext, ref_qplan, key and hash inserts
window_msintnullThe poll's window: milliseconds since the previous poll, at most @MaxPollGapSeconds
ms_missing_indexintnullThe missing index recommendations: their read (the view, or the plans fetched) and their store; null with @CaptureMissingIndexes = 0
missing_indexesintnullThe recommendations of the queries of the poll: the rows the view holds for them, or without the view the rows stored for them; null with @CaptureMissingIndexes = 0
ms_qplan_attributeintnullThe attributes of the query plans: their read from the plans fetched and their store; null with @QPlanLogAttributes = 0

SqlBLT.log_capture_error

The lookups that failed or were skipped during a poll, each with the step (pass), the database, the error and the captured row it belongs to. The poll completes without the value looked up.

Rows
One row per lookup of a poll that failed or was skipped.
Written by
SqlBLT.Collect
Primary key
now, id, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
nowdatetimenot nullPKThe poll
idintnot nullPKNumber of the entry within the poll
passchar(2)not nullThe step: p1 a page lookup failed; p2 a page lookup was skipped, the setting PageIOLatchLookupBudgetMS being spent; h1, a1, o1 the lookup of the waited object by HoBT, allocation unit or object id failed; f1 the lookup of the waited file failed; n1 the lookups in the database failed; s1 the database is not accessible; i1 the input buffer could not be read; v1 text and plan not fetched (SQL Server 2016 or later is required)
dbidintnullThe database of the lookup
error_numberintnullerror_number() of the failure; 0 for a lookup that was skipped
error_messagenvarchar(2048)nullerror_message() of the failure, or the reason of the skip
session_row_idintnullrow_id of the SqlBLT.session_base row concerned
session_idintnullIts session
BLTchar(1)nullIts role: B, T or L

SqlBLT.log_aggregate

The batches of SqlBLT.Aggregate: the polls of each batch, the rows read and the rows written at each grain, the phase times and the outcome. The polls_to of the last completed batch is where the next batch starts.

Rows
One row per batch.
Written by
SqlBLT.Aggregate
Primary key
aggregate_id, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
aggregate_idintnot null identityPKThe batch
starteddatetimenot nullStart of the batch
endeddatetimenullnull until the batch ends
versionchar(13)not nullThe SqlBLT version that ran it
polls_fromdatetimenot nullThe batch window: the polls of SqlBLT.log_capture from this time
polls_todatetimenot nullThe batch window: the polls up to this time; the polls_to of the last completed batch is where the next batch starts
pollsintnot nullPolls in the batch
rows_readintnullsession_base rows of the window
rows_secondintnullRows updated or inserted in SqlBLT.agg_second
rows_minuteintnullRows updated or inserted in SqlBLT.agg_minute
rows_hourintnullRows updated or inserted in SqlBLT.agg_hour
rows_dayintnullRows updated or inserted in SqlBLT.agg_day
ms_readintnullTime to read the SqlBLT.session_base rows
ms_groupintnullTime to group them
ms_writeintnullTime to write the aggregate tables
outcomevarchar(10)not null default ''started, completed, failed
error_messagenvarchar(2048)nullThe error message of a failed batch
ms_totalintnullMilliseconds from started to ended

SqlBLT.log_metrics

The runs of SqlBLT.CollectMetrics: the rows written, the interval since the previous run, the duration and the time of each phase.

Rows
One row per run.
Written by
SqlBLT.CollectMetrics
Primary key
now, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
nowdatetimenot nullPKThe run
versionchar(13)not nullThe SqlBLT version that ran it
rows_writtenintnot nullRows written to SqlBLT.metric_base
secondsintnullThe interval since the previous run; null when no deltas were stored
duration_msintnot nullDuration of the run
waitsintnot nullWait type groups read
countersintnot nullPerformance counters read
io_rowsintnot nullFile IO rows read
ms_waitsintnullTime of the phase: the wait statistics
ms_countersintnullTime of the phase: the counters
ms_otherintnullTime of the phase: the other sources
ms_iointnullTime of the phase: the file IO and the scopes
ms_storeintnullTime of the phase: the store

SqlBLT.log_metrics_aggregate

The batches of SqlBLT.AggregateMetrics: the runs of each batch, the rows read and the rows written at each grain, and the outcome.

Rows
One row per batch.
Written by
SqlBLT.AggregateMetrics
Primary key
aggregate_id, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
aggregate_idintnot null identityPKThe batch
starteddatetimenot nullStart of the batch
endeddatetimenullnull until the batch ends
versionchar(13)not nullThe SqlBLT version that ran it
polls_fromdatetimenot nullThe batch window: the runs of SqlBLT.log_metrics from this time
polls_todatetimenot nullThe batch window: the runs up to this time
pollsintnot nullRuns in the batch
rows_readintnullSqlBLT.metric_base rows of the window
rows_minuteintnullRows updated or inserted in SqlBLT.metric_minute
rows_hourintnullRows updated or inserted in SqlBLT.metric_hour
rows_dayintnullRows updated or inserted in SqlBLT.metric_day
outcomevarchar(10)not null default ''started, completed, failed
error_messagenvarchar(2048)nullThe error message of a failed batch
ms_totalintnullMilliseconds from started to ended

SqlBLT.log_metrics_error

The runs of SqlBLT.CollectMetrics that failed. Such a run writes no row to SqlBLT.log_metrics.

Rows
One row per run that failed.
Written by
SqlBLT.CollectMetrics, for a run that failed
Primary key
now, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
nowdatetimenot nullPKThe run of SqlBLT.CollectMetrics that failed: it wrote no row to SqlBLT.log_metrics
error_numberintnullerror_number() of the failure
error_messagenvarchar(2048)nullerror_message() of the failure

SqlBLT.log_maintenance

The executions of SqlBLT.MaintainPartitions that did the daily work, each with its outcome and totals. The procedure reads this table to decide whether the work of the day is done; an execution that exits at once writes no row.

Rows
One row per execution that did the daily work.
Written by
SqlBLT.MaintainPartitions
Primary key
maint_id, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
maint_idintnot null identityPKThe execution
starteddatetimenot nullStart of the execution; the daily gate of SqlBLT.MaintainPartitions reads it
endeddatetimenullnull while the execution runs, and when it ended without recording its outcome
versionchar(13)not nullThe SqlBLT version that ran it
outcomevarchar(10)not null default ''started, completed, failed
error_messagenvarchar(2048)nullThe error message of a failed execution
ms_totalintnullMilliseconds from started to ended
boundaries_splitintnullBoundaries added: each one a new partition
partitions_truncatedintnullPartitions truncated
boundaries_mergedintnullBoundaries removed: each one an empty partition joined to its neighbour
rows_truncatedbigintnullRows of the partitions truncated
sqltext_deletedintnullref_sqltext rows deleted, each with its ref_sqltext_key rows
qplans_deletedintnullref_qplan rows deleted, each with its ref_qplan_key and ref_qplan_hash rows
ref_rebuild_msintnullThe reference counts were rebuilt from the rows: its time; null = no rebuild
ref_counts_correctedintnullBy that rebuild: the counts that differed from the rows; null = no rebuild

SqlBLT.log_maintenance_partition

The partitions an execution of SqlBLT.MaintainPartitions worked on: a partition created by a split, a partition truncated, a partition whose boundary was merged away. The truncation of a partition and the merge of its boundary are one row.

Rows
One row per partition an execution worked on.
Written by
SqlBLT.MaintainPartitions
Primary key
maint_id, part_id, clustered
Storage
Not partitioned: the rows are kept.
ColumnTypeNullableKeyDefinition
maint_idintnot nullPK → log_maintenancelog_maintenance.maint_id
part_idintnot nullPK1, 2, 3 ... within the execution, in the order of the work
function_namesysnamenot nullThe partition function
table_namesysnamenullThe table truncated; for a split or a merge the table of the function, null when the function has several
range_fromdatetimenullThe partition: from this boundary, which a split added and a merge removed; null for the first partition
range_todatetimenullThe partition: up to, excluding, this boundary; null for the last partition
split_msintnullThe partition was created by a split: its time; null = no split
truncate_msintnullThe partition was truncated: its time, with the count of its references and their removal from SqlBLT.ref_counts; null = no truncation
rows_truncatedbigintnullRows of the partition truncated
sqltext_deletedintnullNot used: the texts are deleted after the retention, and SqlBLT.log_maintenance counts them
qplans_deletedintnullNot used: the plans are deleted after the retention, and SqlBLT.log_maintenance counts them
merge_msintnullThe boundary at range_from was merged away: its time; null = no merge

3.8 Size

The size log: the size of every table and of each daily partition that holds rows, logged once a day by the daily maintenance, and the data type of each table.

SqlBLT.size_type

The data types of the size log: the kinds of data whose size is followed. sqltext is the statement texts and qplantext the query plans; blt is the captured rows and their aggregates, and metric the metric samples and their aggregates, each with one row per grain: base for the rows as captured, then second, minute, hour and day. The rows of one typename sum to its total.

Rows
One row per data type: 11 rows.
Written by
The install script
Primary key
typeid, clustered
Storage
Not partitioned.
ColumnTypeNullableKeyDefinition
typeidsmallintnot nullPKThe data type
typenamevarchar(20)not nullThe kind of data: sqltext, qplantext, blt or metric
grainvarchar(10)nullOf blt and metric: base (the rows as captured), second, minute, hour or day

SqlBLT.size_object

The tables of the size log, each with its data type, so that a logged size carries objid and never a name. A table that holds none of these kinds of data (a dictionary, a log, configuration, state) has no type. SqlBLT.MaintainPartitions adds a table that is not named here yet, without a type.

Rows
One row per table: 52 rows as installed.
Written by
The install script; SqlBLT.MaintainPartitions adds a table it does not name yet
Primary key
objid, clustered
Storage
Not partitioned.
Indexes
ux_size_object: unique, on objname
ColumnTypeNullableKeyDefinition
objidsmallintnot nullPKThe table: the id that a logged size carries
objnamesysnamenot nullThe table, without the schema
typeidsmallintnull→ size_typesize_type.typeid: the table's data type; null = none

SqlBLT.size_table

The size of every table, logged once a day by SqlBLT.MaintainPartitions after its partition work: the rows and, in KB, the space reserved, the data, the indexes and the unused space, counted as sp_spaceused counts them, so that reserved_kb = data_kb + index_kb + unused_kb. maint_id is the execution, whose time SqlBLT.log_maintenance has. A memory-optimized table is not logged.

Rows
One row per table, per execution of the daily maintenance.
Written by
SqlBLT.MaintainPartitions, once a day
Primary key
maint_id, objid, clustered
Storage
Not partitioned: the rows are kept. Page compression.
ColumnTypeNullableKeyDefinition
maint_idintnot nullPK → log_maintenancelog_maintenance.maint_id: the execution that logged the size
objidsmallintnot nullPK → size_objectsize_object.objid
rowsbigintnot nullRows of the table
reserved_kbbigintnot nullThe space allocated to the table and its indexes
data_kbbigintnot nullOf it: the rows, with their large values
index_kbbigintnot nullThe indexes
unused_kbbigintnot nullAllocated and not used yet

SqlBLT.size_partition

The size of each partition of the partitioned tables, logged with SqlBLT.size_table: with a boundary per day, the size of the data retained for each day. part_id numbers the partitions of a table that hold rows, the oldest first; range_from and range_to are the boundaries of the partition. The partitions of a table sum to its row in SqlBLT.size_table.

Rows
One row per partition that holds rows, per table and execution of the daily maintenance.
Written by
SqlBLT.MaintainPartitions, once a day
Primary key
maint_id, objid, part_id, clustered
Storage
Not partitioned: the rows are kept. Page compression.
ColumnTypeNullableKeyDefinition
maint_idintnot nullPK → log_maintenancelog_maintenance.maint_id: the execution that logged the size
objidsmallintnot nullPK → size_objectsize_object.objid
part_idsmallintnot nullPK1, 2, 3 ... within the table: its partitions that hold rows, the oldest first
range_fromdatetimenullThe partition: from this boundary; null for the first partition
range_todatetimenullUp to, excluding, this one; null for the last partition
rowsbigintnot nullRows of the partition
reserved_kbbigintnot nullThe space allocated to the partition
data_kbbigintnot nullOf it: the rows, with their large values
index_kbbigintnot nullThe indexes
unused_kbbigintnot nullAllocated and not used yet

4. Views

SqlBLT.sessions

The captured rows of SqlBLT.session_base with every dictionary id rendered as its value and the text and plan templates rendered. SqlBLT.Collect inserts through this view: its INSTEAD OF INSERT trigger SqlBLT.tr_sessions hands the rows to SqlBLT.load_sessions, which adds new dictionary values, stores new templates and writes the SqlBLT.session_base rows.

ColumnTypeNullableExpression
idintnot nullSqlBLT.session_base.row_id
BLTchar(1)nullSqlBLT.session_base.BLT
session_idsmallintnullSqlBLT.session_base.session_id
blockedsmallintnullSqlBLT.session_base.blocked
topblockintnullSqlBLT.session_base.topblock
req_statusnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.req_status_id
session_statusnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.session_status_id
open_transintnullSqlBLT.session_base.open_trans
elapsed_msbigintnullSqlBLT.session_base.elapsed_ms
wait_time_msbigintnullSqlBLT.session_base.wait_time_ms
req_cpu_msbigintnullSqlBLT.session_base.req_cpu_ms
req_logical_readsbigintnullSqlBLT.session_base.req_logical_reads
req_phys_readsbigintnullSqlBLT.session_base.req_phys_reads
req_writesbigintnullSqlBLT.session_base.req_writes
mem_usedbigintnullSqlBLT.session_base.mem_used
commandnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.command_id
conn_dbidintnullSqlBLT.session_base.conn_dbid
conn_dbnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.conn_db_id
auth_dbidintnullSqlBLT.session_base.auth_dbid
auth_dbnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.auth_db_id
sqltext_sourcechar(1)nullSqlBLT.session_base.sqltext_source
sqltext_objnamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.sqltext_objname_id
wait_dbidbigintnullSqlBLT.session_base.wait_dbid
wait_dbnamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_dbname_id
wait_schnamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_schname_id
wait_objnamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_objname_id
wait_object_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_object_type_id
wait_index_idintnullSqlBLT.session_base.wait_index_id
wait_indexnamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_indexname_id
wait_partition_numberintnullSqlBLT.session_base.wait_partition_number
wait_filenamenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_filename_id
wait_filepathnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_filepath_id
wait_object_idbigintnullSqlBLT.session_base.wait_object_id
wait_file_idbigintnullSqlBLT.session_base.wait_file_id
wait_resourcenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_resource_id
last_wait_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.last_wait_type_id
nowdatetimenot nullSqlBLT.session_base.now
connect_timedatetimenullSqlBLT.session_base.connect_time
last_req_end_timedatetimenullSqlBLT.session_base.last_req_end_time
last_req_start_timedatetimenullSqlBLT.session_base.last_req_start_time
wait_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.wait_type_id
task_wait_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.task_wait_type_id
task_wait_msbigintnullSqlBLT.session_base.task_wait_ms
is_userbitnot nullSqlBLT.session_base.is_user
req_modenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.req_mode_id
tran_begin_timedatetimenullSqlBLT.session_base.tran_begin_time
ms_since_tran_begin_timebigintnullSqlBLT.session_base.ms_since_tran_begin_time
tran_namenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.tran_name_id
is_implicit_transmallintnullSqlBLT.session_base.is_implicit_tran
resource_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.resource_type_id
resource_subtypenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.resource_subtype_id
resource_descriptionnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.resource_descr_id
resource_associated_entity_idbigintnullSqlBLT.session_base.resource_associated_entity_id
resource_lock_partitionintnullSqlBLT.session_base.resource_lock_partition
statement_start_offsetintnullSqlBLT.session_base.statement_start_offset
statement_end_offsetintnullSqlBLT.session_base.statement_end_offset
query_hashbinary(8)nullSqlBLT.session_base.query_hash
query_plan_hashbinary(8)nullSqlBLT.session_base.query_plan_hash
host_namenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.host_name_id
program_namenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.program_name_id
host_process_idintnullSqlBLT.session_base.host_process_id
client_versionbigintnullSqlBLT.session_base.client_version
client_interface_namenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.client_interface_id
login_namenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.login_name_id
tran_isolation_levelsmallintnullSqlBLT.session_base.tran_isolation_level
lock_timeoutintnullSqlBLT.session_base.lock_timeout
deadlock_priorityintnullSqlBLT.session_base.deadlock_priority
net_transportnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.net_transport_id
protocol_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.protocol_type_id
protocol_versionintnullSqlBLT.session_base.protocol_version
encrypt_optionnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.encrypt_option_id
auth_schemenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.auth_scheme_id
node_affinitysmallintnullSqlBLT.session_base.node_affinity
conn_packet_readsbigintnullSqlBLT.session_base.conn_packet_reads
conn_packet_writesbigintnullSqlBLT.session_base.conn_packet_writes
conn_last_readdatetimenullSqlBLT.session_base.conn_last_read
conn_last_writedatetimenullSqlBLT.session_base.conn_last_write
net_packet_sizeintnullSqlBLT.session_base.net_packet_size
client_net_addressnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.client_net_addr_id
client_tcp_portintnullSqlBLT.session_base.client_tcp_port
local_net_addressnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.local_net_addr_id
local_tcp_portintnullSqlBLT.session_base.local_tcp_port
sql_handlevarbinary(64)nullSqlBLT.session_base.sql_handle
secs_since_last_req_endbigintnullSqlBLT.session_base.secs_since_last_req_end
isdbccpagesmallintnullSqlBLT.session_base.isdbccpage
waittypebinary(2)nullSqlBLT.session_base.waittype
qplan_keychar(18)nullSqlBLT.session_base.qplan_key
plan_handlevarbinary(64)nullSqlBLT.session_base.plan_handle
sqltext_chashvarchar(88)nullSqlBLT.ref_sqltext.sqltext_chash, through session_base.sqltextid
qplan_chashvarchar(88)nullSqlBLT.ref_qplan.qplan_chash, through session_base.qplanid
percent_completedecimal(5,2)nullSqlBLT.session_base.percent_complete
est_completion_timebigintnullSqlBLT.session_base.est_completion_time
passchar(2)nullSqlBLT.session_base.pass
error_numberintnullSqlBLT.session_base.error_number
error_messagenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through session_base.error_message_id
req_wait_ms_incbigintnullSqlBLT.session_base.req_wait_ms_inc
req_cpu_ms_incbigintnullSqlBLT.session_base.req_cpu_ms_inc
req_logical_reads_incbigintnullSqlBLT.session_base.req_logical_reads_inc
req_phys_reads_incbigintnullSqlBLT.session_base.req_phys_reads_inc
req_writes_incbigintnullSqlBLT.session_base.req_writes_inc
stmt_wait_ms_incbigintnullSqlBLT.session_base.stmt_wait_ms_inc
stmt_cpu_ms_incbigintnullSqlBLT.session_base.stmt_cpu_ms_inc
stmt_logical_reads_incbigintnullSqlBLT.session_base.stmt_logical_reads_inc
stmt_phys_reads_incbigintnullSqlBLT.session_base.stmt_phys_reads_inc
stmt_writes_incbigintnullSqlBLT.session_base.stmt_writes_inc
child_wait_msbigintnullSqlBLT.session_base.child_wait_ms
child_wait_ms_incbigintnullSqlBLT.session_base.child_wait_ms_inc
qplan_att_idintnullSqlBLT.session_base.qplan_att_id
qplan_time_idintnullSqlBLT.session_base.qplan_time_id
sqltext_parsednvarchar(max)nullconvert(nvarchar(max), decompress(st.sqltext_parsed))
sqltext_unparsednvarchar(max)nullconvert(nvarchar(max), decompress(st.sqltext_unparsed))
qplan_parsednvarchar(max)nullconvert(nvarchar(max), decompress(qp.qplan_parsed))
qplan_unparsednvarchar(max)nullconvert(nvarchar(max), decompress(qp.qplan_unparsed))

SqlBLT.aggregate_second, SqlBLT.aggregate_minute, SqlBLT.aggregate_hour, SqlBLT.aggregate_day

Four views with the same columns, one over each aggregate table: the rows of the table with the name of the set and the names of the keys rendered. A key of a dimension the set lacks is -1 (blt '-') and its name null; the object is rendered as database.schema.object from the parts present, the request as session @ start.

ColumnTypeNullableExpression
agg_timedatetimenot nullthe column of the aggregate table
set_idsmallintnot nullthe column of the aggregate table
set_namevarchar(60)not nullSqlBLT.agg_set.name, through set_id
bltchar(1)not nullthe column of the aggregate table
database_idintnot nullthe column of the aggregate table
databasenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through database_id
wait_dbname_idintnot nullthe column of the aggregate table
wait_schname_idintnot nullthe column of the aggregate table
wait_objname_idintnot nullthe column of the aggregate table
objectnvarchar(4000)nullthe values of wait_dbname_id, wait_schname_id and wait_objname_id that are present, joined by periods: database.schema.object
program_name_idintnot nullthe column of the aggregate table
applicationnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through program_name_id
sqltextidintnot nullthe column of the aggregate table
querynvarchar(2048)nullSqlBLT.ref_sqltext.sqltextleading, through sqltextid
host_name_idintnot nullthe column of the aggregate table
hostnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through host_name_id
login_name_idintnot nullthe column of the aggregate table
loginnvarchar(3072)nullSqlBLT.ref_value.bpat_value, through login_name_id
wait_type_idintnot nullthe column of the aggregate table
wait_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through wait_type_id
qplanidintnot nullthe column of the aggregate table
resource_type_idintnot nullthe column of the aggregate table
resource_typenvarchar(3072)nullSqlBLT.ref_value.bpat_value, through resource_type_id
request_idintnot nullthe column of the aggregate table
requestnvarchar(36)nullsession_id and last_req_start of the row's SqlBLT.ref_request row, written as session @ start; null when the set lacks the request dimension
samplesintnot nullthe column of the aggregate table
polls_presentintnot nullthe column of the aggregate table
sessions_maxintnot nullthe column of the aggregate table
session_secondsbigintnot nullthe column of the aggregate table
wait_msbigintnot nullthe column of the aggregate table
wait_ms_maxbigintnot nullthe column of the aggregate table
elapsed_ms_maxbigintnot nullthe column of the aggregate table
cpu_msbigintnot nullthe column of the aggregate table
logical_readsbigintnot nullthe column of the aggregate table
physical_readsbigintnot nullthe column of the aggregate table
writesbigintnot nullthe column of the aggregate table
child_wait_msbigintnot nullthe column of the aggregate table
child_wait_ms_maxbigintnot nullthe column of the aggregate table
stmt_wait_msbigintnullthe column of the aggregate table
stmt_cpu_msbigintnullthe column of the aggregate table
stmt_logical_readsbigintnullthe column of the aggregate table
stmt_physical_readsbigintnullthe column of the aggregate table
stmt_writesbigintnullthe column of the aggregate table

5. Installed rows

5.1 Dictionary attributes: SqlBLT.ref_type

The 33 attributes of SqlBLT.ref_value, each with the column of SqlBLT.session_base that holds the id of its value and the column of the view SqlBLT.sessions that shows the value.

bpat_idAttribute and view columnColumn of session_base
1req_statusreq_status_id
2session_statussession_status_id
3commandcommand_id
4conn_dbconn_db_id
5auth_dbauth_db_id
6sqltext_objnamesqltext_objname_id
7wait_dbnamewait_dbname_id
8wait_schnamewait_schname_id
9wait_objnamewait_objname_id
10wait_object_typewait_object_type_id
11wait_indexnamewait_indexname_id
bpat_idAttribute and view columnColumn of session_base
12wait_filenamewait_filename_id
13wait_filepathwait_filepath_id
14wait_resourcewait_resource_id
15last_wait_typelast_wait_type_id
16wait_typewait_type_id
17task_wait_typetask_wait_type_id
18req_modereq_mode_id
19tran_nametran_name_id
20resource_typeresource_type_id
21resource_subtyperesource_subtype_id
22resource_descriptionresource_descr_id
bpat_idAttribute and view columnColumn of session_base
23host_namehost_name_id
24program_nameprogram_name_id
25client_interface_nameclient_interface_id
26login_namelogin_name_id
27net_transportnet_transport_id
28protocol_typeprotocol_type_id
29encrypt_optionencrypt_option_id
30auth_schemeauth_scheme_id
31client_net_addressclient_net_addr_id
32local_net_addresslocal_net_addr_id
33error_messageerror_message_id

5.2 Aggregate dimensions: SqlBLT.agg_dimension

BitDimensionKey columns in the aggregate tablesSource columns in session_baseRendered byDescription
1databasedatabase_idconn_db_idref_value (attribute 4)The session's database
2objectwait_dbname_id, wait_schname_id, wait_objname_idwait_dbname_id, wait_schname_id, wait_objname_idref_value (attribute 7, 8, 9)The waited resource's database, schema and object
4applicationprogram_name_idprogram_name_idref_value (attribute 24)program_name of the session
8querysqltextidsqltextidref_sqltextThe text template of the statement
16hosthost_name_idhost_name_idref_value (attribute 23)host_name of the session
32loginlogin_name_idlogin_name_idref_value (attribute 26)login_name of the session
64wait typewait_type_idwait_type_idref_value (attribute 16)wait_type of the request
128planqplanidqplanidref_qplanThe plan template of the statement
256BLTbltBLTThe row's role at the poll: B blocked, T head blocker, L long running
512resource typeresource_type_idresource_type_idref_value (attribute 20)resource_type of the request's wait
1024requestrequest_idsession_id, last_req_start_timeref_requestThe request: its session and start time (SqlBLT.ref_request)

5.3 Aggregate sets: SqlBLT.agg_set

The sets as installed. set_id is the sum of the bits of the set's dimensions. Set 1917 is the one the SqlBLT Portal reports read: one row per request, statement, role, wait type and resource type per bucket.

set_idNameDimensionsStored perEnabled
1databasedatabasehour, dayyes
2objectobjectsecond, minute, hour, dayyes
3database + objectdatabase, objecthour, dayyes
4applicationapplicationhour, dayyes
8queryqueryhour, dayyes
9database + querydatabase, queryhour, dayyes
12application + queryapplication, queryhour, dayyes
16hosthostsecond, minute, hour, dayyes
20host + applicationapplication, hosthour, dayyes
32loginloginsecond, minute, hour, dayyes
36login + applicationapplication, loginhour, dayyes
64wait typewait typesecond, minute, hour, dayyes
66object + wait typeobject, wait typesecond, minute, hour, dayyes
255all dimensionsdatabase, object, application, query, host, login, wait type, planhour, dayyes
1917BLT statementdatabase, application, query, host, login, wait type, BLT, resource type, requestminute, hour, dayyes

5.4 Metrics: SqlBLT.metric

The 115 metrics as installed, all enabled. Kind: G a gauge, stored as sampled; D a delta, the growth of a cumulative value over the interval since the previous run; A an average, the growth of a value over the growth of its base. Shown: in the default band of the reports. A file IO metric is collected per database.

IdMetricCategoryKindUnitShownSourceRead from the sourceDescription
1Wait: SOS_SCHEDULER_YIELDwaitDmsyessys.dm_os_wait_statswait types like SOS[_]SCHEDULER[_]YIELDCPU: runnable tasks giving up the scheduler
2Wait: ASYNC_NETWORK_IOwaitDmsyessys.dm_os_wait_statswait types like ASYNC[_]NETWORK[_]IOThe client not consuming results
3Wait: LCK (locks)waitDmsyessys.dm_os_wait_statswait types like LCK[_]M[_]%All lock waits
4Wait: LATCHwaitDmsyessys.dm_os_wait_statswait types like LATCH[_]%Non-buffer latches
5Wait: PAGELATCHwaitDmsyessys.dm_os_wait_statswait types like PAGELATCH[_]%In-memory page latches (tempdb and hot pages)
6Wait: PAGEIOLATCHwaitDmsyessys.dm_os_wait_statswait types like PAGEIOLATCH[_]%Pages read from disk
7Wait: WRITELOGwaitDmsyessys.dm_os_wait_statswait types like WRITELOGLog writes at commit
8Wait: CXPACKETwaitDmsyessys.dm_os_wait_statswait types like CXPACKETparallelism: producers
9Wait: CXCONSUMERwaitDmsyessys.dm_os_wait_statswait types like CXCONSUMERparallelism: consumers
10Wait: CXSYNCwaitDmsyessys.dm_os_wait_statswait types like CXSYNC[_]%Parallelism synchronisation (2019 and later)
11Wait: BACKUPIOwaitDmsyessys.dm_os_wait_statswait types like BACKUPIOBackup IO
12Wait: RESOURCE_SEMAPHOREwaitDmssys.dm_os_wait_statswait types like RESOURCE[_]SEMAPHOREMemory grants
13Wait: RESOURCE_SEMAPHORE_QUERY_COMPILEwaitDmssys.dm_os_wait_statswait types like RESOURCE[_]SEMAPHORE[_]QUERY[_]COMPILECompile memory
14Wait: THREADPOOLwaitDmssys.dm_os_wait_statswait types like THREADPOOLWorker thread starvation
15Wait: HADR_SYNC_COMMITwaitDmssys.dm_os_wait_statswait types like HADR[_]SYNC[_]COMMITAvailability group synchronous commit
16Wait: IO_COMPLETIONwaitDmssys.dm_os_wait_statswait types like IO[_]COMPLETIONNon-data-page IO
17Wait: ASYNC_IO_COMPLETIONwaitDmssys.dm_os_wait_statswait types like ASYNC[_]IO[_]COMPLETIONAsynchronous IO (backups, file growth)
18Wait: LOGBUFFERwaitDmssys.dm_os_wait_statswait types like LOGBUFFERLog buffer space
19Wait: PREEMPTIVEwaitDmssys.dm_os_wait_statswait types like PREEMPTIVE[_]%Calls outside the scheduler (OS, backup, authentication)
20Wait: OLEDBwaitDmssys.dm_os_wait_statswait types like OLEDBLinked servers and some DMVs
21Wait: MEMORY_ALLOCATION_EXTwaitDmssys.dm_os_wait_statswait types like MEMORY[_]ALLOCATION[_]EXTMemory allocation
22Wait: RESERVED_MEMORY_ALLOCATION_EXTwaitDmssys.dm_os_wait_statswait types like RESERVED[_]MEMORY[_]ALLOCATION[_]EXTReserved memory allocation
23Wait: totalwaitDmsyessys.dm_os_wait_statsEvery wait type but the benign ones of SqlBLT.metric_wait_skip
24Signal wait: totalwaitDmssys.dm_os_wait_statsTime between the end of a wait and running again: CPU pressure
25Wait: otherwaitDmsyessys.dm_os_wait_statsThe total less the tracked groups
40Batch Requests/seccounterD/syessys.dm_os_performance_countersSQL Statistics: Batch Requests/sec
41SQL Compilations/seccounterD/ssys.dm_os_performance_countersSQL Statistics: SQL Compilations/sec
42SQL Re-Compilations/seccounterD/ssys.dm_os_performance_countersSQL Statistics: SQL Re-Compilations/sec
43User ConnectionscounterGcountsys.dm_os_performance_countersGeneral Statistics: User Connections
44Processes blockedcounterGcountyessys.dm_os_performance_countersGeneral Statistics: Processes blocked
45Logins/seccounterD/ssys.dm_os_performance_countersGeneral Statistics: Logins/sec
46Page life expectancycounterGsyessys.dm_os_performance_countersBuffer Manager: Page life expectancy
47Page reads/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Page reads/sec
48Page writes/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Page writes/sec
49Lazy writes/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Lazy writes/sec
50Checkpoint pages/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Checkpoint pages/sec
51Page lookups/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Page lookups/sec
52Memory Grants PendingcounterGcountyessys.dm_os_performance_countersMemory Manager: Memory Grants Pending
53Memory Grants OutstandingcounterGcountsys.dm_os_performance_countersMemory Manager: Memory Grants Outstanding
54Total Server Memory (KB)counterGKBsys.dm_os_performance_countersMemory Manager: Total Server Memory (KB)
55Target Server Memory (KB)counterGKBsys.dm_os_performance_countersMemory Manager: Target Server Memory (KB)
56Transactions/seccounterD/syessys.dm_os_performance_countersDatabases: Transactions/sec (_Total)
57Log Flushes/seccounterD/ssys.dm_os_performance_countersDatabases: Log Flushes/sec (_Total)
58Log Flush Wait TimecounterDmsyessys.dm_os_performance_countersDatabases: Log Flush Wait Time (_Total)ms waited for log flushes
59Log Bytes Flushed/seccounterD/ssys.dm_os_performance_countersDatabases: Log Bytes Flushed/sec (_Total)bytes
60Active TransactionscounterGcountsys.dm_os_performance_countersDatabases: Active Transactions (_Total)
61Lock Requests/seccounterD/ssys.dm_os_performance_countersLocks: Lock Requests/sec (_Total)
62Lock Waits/seccounterD/syessys.dm_os_performance_countersLocks: Lock Waits/sec (_Total)
63Lock Wait Time (ms)counterDmssys.dm_os_performance_countersLocks: Lock Wait Time (ms) (_Total)
64Number of Deadlocks/seccounterD/syessys.dm_os_performance_countersLocks: Number of Deadlocks/sec (_Total)
65Lock Timeouts/seccounterD/ssys.dm_os_performance_countersLocks: Lock Timeouts/sec (_Total)
66Latch Waits/seccounterD/ssys.dm_os_performance_countersLatches: Latch Waits/sec
67Average Latch Wait Time (ms)counterAmssys.dm_os_performance_countersLatches: Average Latch Wait Time (ms), base Average Latch Wait Time Base
68Total Latch Wait Time (ms)counterDmssys.dm_os_performance_countersLatches: Total Latch Wait Time (ms)
69Full Scans/seccounterD/ssys.dm_os_performance_countersAccess Methods: Full Scans/sec
70Page Splits/seccounterD/ssys.dm_os_performance_countersAccess Methods: Page Splits/sec
71Index Searches/seccounterD/ssys.dm_os_performance_countersAccess Methods: Index Searches/sec
72Forwarded Records/seccounterD/ssys.dm_os_performance_countersAccess Methods: Forwarded Records/sec
73Table Lock Escalations/seccounterD/ssys.dm_os_performance_countersAccess Methods: Table Lock Escalations/sec
74Plan cache hit ratiocounterG%sys.dm_os_performance_countersPlan Cache: Cache Hit Ratio (_Total), base Cache Hit Ratio Base
75Plan cache pagescounterGpagessys.dm_os_performance_countersPlan Cache: Cache Pages (_Total)
76Resource pool CPU usage %counterG%yessys.dm_os_performance_countersResource Pool Stats: CPU usage % (every instance), base CPU usage % baseEvery resource pool: each pool's ratio over its base counter, summed
77Active parallel threadscounterGcountsys.dm_os_performance_countersWorkload Group Stats: Active parallel threads (every instance)Every workload group, summed
78Queued requestscounterGcountsys.dm_os_performance_countersWorkload Group Stats: Queued requests (every instance)Every workload group, summed
79Active requests (workload group)counterGcountsys.dm_os_performance_countersWorkload Group Stats: Active requests (every instance)Every workload group, summed
80Query optimizations/seccounterD/ssys.dm_os_performance_countersWorkload Group Stats: Query optimizations/sec (every instance)Every workload group, summed
81Longest Transaction Running TimecounterGssys.dm_os_performance_countersTransactions: Longest Transaction Running Time
82Version Store Size (KB)counterGKBsys.dm_os_performance_countersTransactions: Version Store Size (KB)
83Free Space in tempdb (KB)counterGKBsys.dm_os_performance_countersTransactions: Free Space in tempdb (KB)
84Errors/seccounterD/ssys.dm_os_performance_countersSQL Errors: Errors/sec (_Total)
85Temp Tables Creation RatecounterD/ssys.dm_os_performance_countersGeneral Statistics: Temp Tables Creation Rate
86Workfiles Created/seccounterD/ssys.dm_os_performance_countersAccess Methods: Workfiles Created/sec
87Worktables Created/seccounterD/ssys.dm_os_performance_countersAccess Methods: Worktables Created/sec
88Readahead pages/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Readahead pages/sec
89Background writer pages/seccounterD/ssys.dm_os_performance_countersBuffer Manager: Background writer pages/sec
90AG log send queue (KB)counterGKBsys.dm_os_performance_countersDatabase Replica: Log Send Queue (_Total)Availability groups
91AG recovery queue (KB)counterGKBsys.dm_os_performance_countersDatabase Replica: Recovery Queue (_Total)Availability groups
92AG transaction delay (ms)counterGmssys.dm_os_performance_countersDatabase Replica: Transaction Delay (_Total)Availability groups
93AG mirrored write transactions/seccounterD/ssys.dm_os_performance_countersDatabase Replica: Mirrored Write Transactions/sec (_Total)Availability groups
100SQL process CPU %cpuG%yessys.dm_os_ring_buffers (scheduler monitor)The scheduler monitor ring buffer, per minute
101Other process CPU %cpuG%yessys.dm_os_ring_buffers (scheduler monitor)CPU used by other processes
102System idle %cpuG%sys.dm_os_ring_buffers (scheduler monitor)
103Azure average CPU %cpuG%sys.dm_db_resource_stats (Azure SQL Database)Azure SQL Database: sys.dm_db_resource_stats
104Azure average data IO %cpuG%sys.dm_db_resource_stats (Azure SQL Database)Azure SQL Database
105Azure average log write %cpuG%sys.dm_db_resource_stats (Azure SQL Database)Azure SQL Database
106Azure average memory %cpuG%sys.dm_db_resource_stats (Azure SQL Database)Azure SQL Database
107Azure max worker %cpuG%sys.dm_db_resource_stats (Azure SQL Database)Azure SQL Database
110Runnable tasksschedulerGcountyessys.dm_os_schedulersTasks waiting for a scheduler: CPU queueing
111Pending disk IOschedulerGcountsys.dm_os_schedulers
112WorkersschedulerGcountsys.dm_os_schedulers
113TasksschedulerGcountsys.dm_os_schedulers
120Memory grants waitingmemoryGcountsys.dm_exec_query_resource_semaphoressys.dm_exec_query_resource_semaphores
121Memory grants grantedmemoryGcountsys.dm_exec_query_resource_semaphores
122Memory grants available (MB)memoryGMBsys.dm_exec_query_resource_semaphores
123SQL memory in use (MB)memoryGMBsys.dm_os_process_memorysys.dm_os_process_memory
124SQL memory utilization %memoryG%sys.dm_os_process_memory
130User sessionssessionGcountsys.dm_exec_sessions
131Active user requestssessionGcountyessys.dm_exec_requests
132Blocked requestssessionGcountyessys.dm_exec_requests
133Suspended requestssessionGcountsys.dm_exec_requestsRequests waiting
140tempdb version store (MB)tempdbGMBtempdb.sys.dm_db_file_space_usage
141tempdb user objects (MB)tempdbGMBtempdb.sys.dm_db_file_space_usage
142tempdb internal objects (MB)tempdbGMBtempdb.sys.dm_db_file_space_usage
143tempdb free (MB)tempdbGMBtempdb.sys.dm_db_file_space_usage
150Data file readsioDcountsys.dm_io_virtual_file_statsper databasePer database
151Data file read MBioDMBsys.dm_io_virtual_file_statsper databasePer database
152Data file read stall (ms)ioDmsyessys.dm_io_virtual_file_statsper databasePer database; latency = stall / reads
153Data file writesioDcountsys.dm_io_virtual_file_statsper databasePer database
154Data file write MBioDMBsys.dm_io_virtual_file_statsper databasePer database
155Data file write stall (ms)ioDmssys.dm_io_virtual_file_statsper databasePer database; latency = stall / writes
156Log file writesioDcountsys.dm_io_virtual_file_statsper databasePer database
157Log file write MBioDMBsys.dm_io_virtual_file_statsper databasePer database
158Log file write stall (ms)ioDmsyessys.dm_io_virtual_file_statsper databasePer database; latency = stall / writes
159Log file readsioDcountsys.dm_io_virtual_file_statsper databasePer database
160Log file read stall (ms)ioDmssys.dm_io_virtual_file_statsper databasePer database

Wait types left out of the wait totals (SqlBLT.metric_wait_skip), as LIKE patterns: BROKER[_]%, CHECKPOINT[_]QUEUE, CHKPT, CLR[_]%, DBMIRROR%, DIRTY[_]PAGE[_]POLL, DISPATCHER[_]QUEUE[_]SEMAPHORE, FT[_]%, HADR[_]FILESTREAM[_]IOMGR[_]IOCOMPLETION, HADR[_]WORK[_]QUEUE, HADR[_]NOTIFICATION[_]DEQUEUE, HADR[_]TIMER[_]TASK, HADR[_]CLUSAPI[_]CALL, HADR[_]LOGCAPTURE[_]WAIT, KSOURCE[_]WAKEUP, LAZYWRITER[_]SLEEP, LOGMGR[_]QUEUE, ONDEMAND[_]TASK[_]QUEUE, PARALLEL[_]REDO[_]%, PREEMPTIVE[_]XE[_]%, PREEMPTIVE[_]SP[_]SERVER[_]DIAGNOSTICS%, PREEMPTIVE[_]HADR[_]LEASE[_]MECHANISM, PREEMPTIVE[_]OS[_]LIBRARYOPS, PWAIT[_]%, QDS[_]%, REQUEST[_]FOR[_]DEADLOCK[_]SEARCH, RESOURCE[_]QUEUE, SERVER[_]IDLE[_]CHECK, SLEEP[_]%, SNI[_]HTTP[_]ACCEPT, SOS[_]WORK[_]DISPATCHER, SP[_]SERVER[_]DIAGNOSTICS[_]SLEEP, SQLTRACE[_]%, STARTUP[_]DEPENDENCY[_]MANAGER, TRACEWRITE, UCS[_]SESSION[_]REGISTRATION, VDI[_]CLIENT[_]OTHER, WAITFOR, WAIT[_]FOR[_]RESULTS, WAIT[_]XTP[_]%, XE[_]%.

5.5 Settings: SqlBLT.config_setting

The 30 settings with the values installed. To change one, update value in its row; it applies from the next execution of the procedure.

ProcedureSettingValueRangeDescription
CollectWaitTimeFilterMS100 to 2,147,483,647A blocking hierarchy is kept, with all its sessions, when one of its B rows has waited longer than this; L = user requests older than this
CollectPageIOLatchLookupBudgetMS50000 to 2,147,483,647Per run: page lookups of PAGEIOLATCH rows beyond this are skipped (pass p2); 0 = none
CollectMaxSleepingBatchChars80000 to 2,147,483,647Text kept for a sleeping T row, whose only text is its whole most recent batch
CollectKeepDatabaseNames10 to 1Text and plan templates: 1 = database names stay, 0 = each database name becomes ? (system databases stay)
CollectKeepSchemaNames10 to 1Text and plan templates: 1 = schema names stay, 0 = each schema name becomes ? (dbo, sys and INFORMATION_SCHEMA stay)
CollectKeepObjectNames10 to 1Text and plan templates: 1 = object names stay, 0 = each table, view, function, procedure and index name becomes ? (sys objects and sp_/xp_ names stay)
CollectParseSqlText10 to 1Statement texts: 1 = each text is de-parameterised and stored as its template, 0 = the SQL parser is not run and each distinct text as captured is a statement of its own
CollectStoreSqlTextSample10 to 1Statement texts: 1 = the text as captured is stored (with ParseSqlText = 1: the first original text of each template, as a sample), 0 = it is not stored
CollectQPlanStatementText20 to 2Plan template: 0 = remove the statement text, 1 = keep the original statement text, 2 = keep the parsed statement text
CollectQPlanKeepMissingIndexes00 to 1Plan template: 0 = MissingIndexes removed, 1 = kept with Impact set to 0
CollectParseQPlans10 to 1Query plans: 1 = each plan is de-parameterised and stored as its template, 0 = the plan parser is not run and each distinct plan fetched is a plan of its own (with QPlanSkipStorageOfKnownHashes = 1 a plan is not stored when its query_plan_hash already has one)
CollectStoreQPlanSample10 to 1Query plans: 1 = the plan as captured is stored (with ParseQPlans = 1: the first original plan of each template, as a sample), 0 = it is not stored
CollectQPlanSkipStorageOfKnownHashes10 to 1Plan storage: 1 = a statement whose query_plan_hash already has a template is not parsed or stored again and its rows map to that template, 0 = every distinct plan fetched is stored, keyed by its raw hash
CollectMaxPollGapSeconds601 to 2,147,483,647increments: a poll's window is the time since the previous poll, at most this many seconds; a row's increments are its request's and statement's work in the window
CollectCaptureMissingIndexes10 to 1Missing index recommendations of SQL Server for the queries of the requests captured: 1 = they are stored (SQL Server 2019 and later: read from sys.dm_db_missing_index_group_stats_query at every poll; before it: read from each plan a poll fetches), 0 = they are not read
CollectQPlanLogAttributes10 to 1Attributes of the query plans (warnings of the query optimizer, forced plan, plan guide, compile time and memory): 1 = the plan of every request captured is fetched at every poll and its attributes are logged, 0 = they are not logged and a plan is fetched only to be stored
CollectMetricsMaxIntervalSeconds36001 to 2,147,483,647A previous run older than this gives no deltas: the state is rebuilt
CollectMetricsSkipIdleDatabaseIO10 to 11 = a per-database file IO row with no activity in the interval (a zero delta) is not stored; the aggregates' rates divide by the bucket's seconds, so a missing row counts as zero
AggregateMaxPollsPerBatch301 to 2,147,483,647Polls per batch
AggregateMaxBatches201 to 2,147,483,647Batches per execution
AggregateStatementFirstSampleNull00 to 1Statement sums: 1 = the first sample of a statement adds nothing to stmt_cpu_ms, stmt_logical_reads, stmt_physical_reads and stmt_writes, 0 = it adds its request increments
AggregateMetricsMaxPollsPerBatch1201 to 2,147,483,647Runs per batch
AggregateMetricsMaxBatches501 to 2,147,483,647Batches per execution
AggregateMetricsInMemoryWorkTables00 to 1Where a batch is staged: 1 = the memory-optimized tables SqlBLT.metric_agg_polls and SqlBLT.metric_agg_rows, created when missing; 0 = temporary tables
MaintainPartitionsDailyCleanupAfterHour10 to 230 to 23: the first execution at or after this hour of the day does the work; every other execution exits
MaintainPartitionsDeleteOrphanedSQLText10 to 11 = delete the statement texts that no row references any more: those without a reference count in SqlBLT.ref_counts
MaintainPartitionsDeleteOrphanedQPlans10 to 11 = delete the query plans that no row references any more: those without a reference count in SqlBLT.ref_counts
MaintainPartitionsMaxRetriesPerDay30 to 100After a failed execution: the number of further executions of that day that try again; 0 = none before the next day
MaintainPartitionsRebuildRefCountsDayOfMonth00 to 311 to 31: the execution of that day of every month rebuilds the reference counts from the rows (in a month with fewer days: on its last day); 0 = no monthly rebuild
MaintainPartitionsRebuildRefCountsDayOfWeek00 to 71 = Monday to 7 = Sunday: the execution of that day of every week rebuilds the reference counts from the rows; 0 = no weekly rebuild

5.6 Partition functions: SqlBLT.config_partition

The nine partition functions with the values installed: RANGE RIGHT on a datetime column, each with a scheme of its name (ps in place of pf) on the default filegroup. With partitions_retained = n the current partition and the n before it keep their rows, and older partitions are truncated; 0 keeps every partition. SqlBLT.MaintainPartitions keeps future_boundaries boundaries ahead of now.

FunctionSchemeTablePartitioning columnBoundary periodFuture boundariesPartitions retained
pfSqlBLTpsSqlBLTsession_basenowday3014
pfSqlBLTSecondpsSqlBLTSecondagg_secondagg_timeday3014
pfSqlBLTMinutepsSqlBLTMinuteagg_minuteagg_timeday3090
pfSqlBLTHourpsSqlBLTHouragg_houragg_timeday30183
pfSqlBLTDaypsSqlBLTDayagg_dayagg_timeday30365
pfSqlBLTMetricpsSqlBLTMetricmetric_basenowday3014
pfSqlBLTMetricMinutepsSqlBLTMetricMinutemetric_minuteagg_timeday3090
pfSqlBLTMetricHourpsSqlBLTMetricHourmetric_houragg_timeday30183
pfSqlBLTMetricDaypsSqlBLTMetricDaymetric_dayagg_timeday30365

5.7 Data types of the size log: SqlBLT.size_type, SqlBLT.size_object

The 11 data types as installed, each with the tables SqlBLT.size_object gives it. The size of a data type is the sum of its tables in SqlBLT.size_table; the rows of one typename sum to its total. The other 38 tables have no data type.

typeidtypenamegrainTables
1sqltextref_sqltext, ref_sqltext_key
2qplantextref_qplan, ref_qplan_key, ref_qplan_hash
3bltbasesession_base
4bltsecondagg_second
5bltminuteagg_minute
6blthouragg_hour
7bltdayagg_day
8metricbasemetric_base
9metricminutemetric_minute
10metrichourmetric_hour
11metricdaymetric_day

6. Procedures, functions and jobs

6.1 Procedures of the schema SqlBLT

ProcedureWhat it does
SqlBLT.CollectJob SqlBLT_Collector, every 10 seconds. Samples the blocked requests (B), the heads of their blocking chains (T) and the long running requests (L); resolves the resources waited for to object names in their databases; fetches statement texts and query plans and has the new ones parsed into templates; stores the missing index recommendations of SQL Server for the queries of the rows (setting CaptureMissingIndexes) in SqlBLT.ref_missing_index and SqlBLT.ref_query_missing_index; computes the increments of each row from SqlBLT.request_state; writes the rows through the view SqlBLT.sessions, then one row to SqlBLT.log_capture and the lookups that failed to SqlBLT.log_capture_error. With the setting QPlanLogAttributes it logs the attributes of the plan of every row in the tables of the query plan attributes.
SqlBLT.load_sessionsCalled by the trigger of SqlBLT.sessions with the rows of one insert: adds new dictionary values to SqlBLT.ref_value, parses and stores any text or plan given, writes one SqlBLT.session_base row per row, and adds the references of those rows to the reference counts of SqlBLT.ref_counts, in the same transaction.
SqlBLT.AggregateJob SqlBLT_Aggregate, first step, every 10 minutes. Computes the aggregate tables from SqlBLT.session_base in batches of polls, continuing from the last completed batch in SqlBLT.log_aggregate. A batch takes the next polls of SqlBLT.log_capture, groups their rows by every enabled set at each grain the set is stored at, and adds the result to the four aggregate tables: rows that exist are updated, the rest inserted, and the references of the rows inserted are added to the reference counts of SqlBLT.ref_counts. It catalogues the requests of the batch in SqlBLT.ref_request. A batch is one transaction; a batch that fails is logged, raised and repeated by the next execution. One execution runs at a time.
SqlBLT.CollectMetricsJob SqlBLT_Metrics, every 10 seconds. Samples the instance for the enabled metrics of SqlBLT.metric and writes the rows to SqlBLT.metric_base and one row to SqlBLT.log_metrics; a failure goes to SqlBLT.log_metrics_error and is raised. A cumulative value is stored as its growth since the previous run, whose values are kept in SqlBLT.metric_state.
SqlBLT.AggregateMetricsJob SqlBLT_Aggregate, second step. Computes SqlBLT.metric_minute, SqlBLT.metric_hour and SqlBLT.metric_day from SqlBLT.metric_base in batches of runs, continuing from the last completed batch in SqlBLT.log_metrics_aggregate. A batch is one transaction, staged in temporary tables or, with the setting InMemoryWorkTables = 1, in the memory-optimized tables SqlBLT.metric_agg_polls and SqlBLT.metric_agg_rows. One execution runs at a time.
SqlBLT.MaintainPartitionsJob SqlBLT_Aggregate, third step. It does its work once a day, in the first execution at or after the hour of the setting DailyCleanupAfterHour; every other execution exits at once. For each partition function of SqlBLT.config_partition it adds the boundaries of the coming periods, truncates the partitions that are no longer retained, takes the references of their rows off the reference counts of SqlBLT.ref_counts, and merges their boundaries away. The text and plan templates that have no reference count left are then deleted (settings DeleteOrphanedSQLText and DeleteOrphanedQPlans), with the missing index recommendations of those texts. The reference counts are rebuilt from the rows on the days that the settings RebuildRefCountsDayOfMonth and RebuildRefCountsDayOfWeek name. It then logs the size of every table in SqlBLT.size_table and of each partition that holds rows in SqlBLT.size_partition. The work is logged in SqlBLT.log_maintenance and SqlBLT.log_maintenance_partition; after a failure the next executions of that day try again, at most MaxRetriesPerDay times. The attributes of a deleted plan are deleted with it, then the text values that no row names any more.
SqlBLT.SetForeignKeysExecuted by a DBA, not by a job. Creates or drops the 137 foreign keys of the SqlBLT tables: all of them, or those of the tables of one section (capture, dictionaries, aggregates, metrics, logging, size), WITH CHECK or WITH NOCHECK. An installation has no foreign key until it is executed, and SqlBLT works the same without them.

6.2 Functions, table type and trigger of the schema SqlBLT

ObjectWhat it is
SqlBLT.fnParseSQLJson_Interp
SqlBLT.fnParseSQLJson_InMem
The SQL parser, a scalar function: parses one T-SQL batch in a single scan and returns its de-parameterised text, in which each literal is replaced by ?, or a JSON text with the statements of the batch and the objects each statement references. Options keep or mask database, schema and object names. _InMem is the same definition natively compiled, created when the database supports In-Memory OLTP; the procedures call it when it exists and _Interp otherwise.
SqlBLT.fnParseQPlan_Interp
SqlBLT.fnParseQPlan_InMem
The plan parser, a scalar function: returns the template of a showplan XML text, with the compile, statistics, memory and hardware detail removed, the estimates set to 0, the literals and generated names masked and the shape and operators kept. _InMem is the same definition natively compiled.
SqlBLT.fnParseSQLA table-valued function: the statements of a T-SQL batch and the objects each statement references, one row per statement and one per referenced object. Created when the compatibility level of the database is 130 or higher. The collector does not call it.
SqlBLT.sessions_rowsTable type: the rows of one insert into SqlBLT.sessions, as the trigger hands them to SqlBLT.load_sessions.
SqlBLT.tr_sessionsINSTEAD OF INSERT trigger on the view SqlBLT.sessions: hands the rows to SqlBLT.load_sessions.

6.3 Report schema SqlBLTPortal

The procedures that the SqlBLT Portal calls. They read the SqlBLT tables by ownership chaining and change nothing. The database role SqlBLT_Reader holds EXECUTE on the schema and nothing else, which is all that a user of the Portal needs.

ObjectWhat it returns
SqlBLTPortal.portal_versionThe version of the report procedures, the SqlBLT version installed, and whether the database holds the aggregate set 1917.
SqlBLTPortal.portal_captureOne row: the polls held, the SqlBLT version, the range that the aggregate set 1917 covers at each grain, and the requests catalogued.
SqlBLTPortal.portal_namesThe values of the filter dimensions seen in a range: role, database, application, host, login, wait type and resource type.
SqlBLTPortal.portal_reportThe TopX report: the rows of the aggregate set 1917 at a grain within a range, filtered and grouped by the dimensions split on, the top rows first, with the missing index recommendations of SQL Server for the statements of those rows and the attributes of their query plans.
SqlBLTPortal.portal_hierarchiesThe Timeline report: the top blockers of a range by their child waits, each with the blocking hierarchies beneath it as lanes over time, from SqlBLT.session_base, with the missing index recommendations of SQL Server for the requests of the lanes and the attributes of their query plans.
SqlBLTPortal.portal_qplan_warningsThe warnings of the query optimizer found in a range, each with the column, conversion or index it names, and the statements of each.
SqlBLTPortal.portal_statementOne statement in a range: its text and totals, and the requests that ran it.
SqlBLTPortal.portal_requestOne request: its catalogue row, its roles in the aggregates and its samples while SqlBLT.session_base holds them.
SqlBLTPortal.portal_textThe text of one statement: the parsed template when held, else the original text.
SqlBLTPortal.portal_planOne query plan: the raw plan when held, else the parsed template.
SqlBLTPortal.portal_metricsThe metrics band of the reports: the metrics of SqlBLT.metric, the scopes of the per-database metrics, and the series of the chosen metrics at a grain within a range.
SqlBLTPortal.portal_ids
SqlBLTPortal.portal_metric_keys
SqlBLTPortal.portal_text_filters
Table types of the procedures' list parameters: a list of ids, a list of metric and scope ids, and the filters on the text of a statement.

6.4 SQL Server Agent jobs

Created by the install script, owned by sa; none on Azure SQL Database, which has no SQL Server Agent. The steps pass no parameters.

JobScheduleStepCommand
SqlBLT_Collectorevery 10 secondsCollectSqlBLTexec SqlBLT.Collect;
SqlBLT_Metricsevery 10 secondsCollectMetricsSqlBLTexec SqlBLT.CollectMetrics;
SqlBLT_Aggregateevery 10 minutesAggregateSqlBLTexec SqlBLT.Aggregate;
AggregateMetricsSqlBLTexec SqlBLT.AggregateMetrics;
MaintainPartitionsSqlBLTexec SqlBLT.MaintainPartitions;