/* ------------------------------ *\

    Copyright 2021 by Wingenious

   see README for license details

\* ------------------------------ */


------------------------
SQLFacts Version History
------------------------


20210725
========

initial release


20210805
========

IndexNeedsPlus
parsed index impact value into a separate column


20210810
========

QueryHistory
fixed an issue that caused ad hoc queries to be filtered out

IndexNeedsPlus
fixed an issue that caused ad hoc queries to be filtered out


20210812
========

QueryHistory
renamed several columns, in both result sets, for better clarity
added a variable to quickly switch between run time and CPU time


20210824
========

MetricsNow
added monitoring for observations of all wait_type values

MetricsHistory
added monitoring for observations of all wait_type values

AGLatency
introduction of a new tool (18)

Statistics
introduction of a new tool (19)


20210828
========

Statistics
added two more columns

SQLAgent
introduction of a new tool (20)


20210829
========

SQLAgent
added a column to the first result set

Search
created two variants to replace the original tool, SearchFast and SearchWild


20210831
========

Search
enhanced results and performance of (optionally) excluding SQL code comments


20210906
========

Resources
introduction of a new tool (21)


20210912
========

Auditor
introduction of a new tool (22)


20210915
========

Locksmith
introduction of a new tool (23)


20210926
========

GenerateSQL
introduction of a new tool (24)


20210928
========

GenerateSQL
improved handling of TVFs
improved handling of redundant references


20211004
========

SQLFacts
added Percent column to Table Details, by name
added Percent column to Table Details, by row count

Deadlocks
introduction of a new tool (25)


20211010
========

GenerateSQL
added a new variant, GenerateSQL_IN, to generate INSERT statements
added a new variant, GenerateSQL_UP, to generate UPDATE statements

BACKUP
added a result set for a summary of BACKUP operations
rearranged/renamed columns of the original result set


20211021
========

Databases
moved GBs_File_MIN column to result set 4, by filegroup
moved GBs_File_MAX column to result set 4, by filegroup

Blocking
introduction of a new tool (26)


20211103
========

MetricsHistory
added an alerting component (MetricsAlerts)


20211109
========

MetricsHistory
renamed some alerts for better clarity (MetricsAlerts)

Search
added SQL Server Agent jobs to Search_Fast
added SQL Server Agent jobs to Search_Wild
added a new variant for searching names of objects/columns


20211115
========

Search
Search_Fast, excluded generated objects
Search_Wild, excluded generated objects
Search_Wild, took out assumed wildcards
Search_Name, took out assumed wildcards

MetricsHistory
fixed an issue where SIO and PIO were mixed up (MetricsAlerts)

Statistics
added column-level statistics
added Nature column as a short form of key index information

IndexHistory
added Nature column as a short form of key index information

IndexActivity
added Nature column as a short form of key index information


20211122
========

Search
Search_Fast, added second result set for summary of matches
Search_Wild, added second result set for summary of matches

AGLatency
added brackets around database name in dynamic SQL code

Auditor
added brackets around database name in dynamic SQL code

Bufferin
added brackets around database name in dynamic SQL code

Databases
added brackets around database name in dynamic SQL code

Locksmith
added brackets around database name in dynamic SQL code


20211124
========

Janitor
introduction of a new tool (27)


20220103
========

Indexer
introduction of a new tool with three variants (28)
Indexer_Columns
Indexer_DBAdmin
Indexer_SQLCode


20220111
========

Indexer
Indexer_SQLCode
fixed an issue with clustered columnstore indexes


20220218
========

Indexer
Indexer_Examine
added a new variant for examining potential index issues

Indexer
Indexer_SQLCode
added a new column for internal purposes and adjusted an existing column

IndexHistory
added a new column for internal purposes and adjusted an existing column

Browse
added a new column for internal purposes and adjusted an existing column

SQLFacts
added a new column for internal purposes and adjusted an existing column
made several adjustments to Questionable Indexes

SQLFacts
SQLFacts.exe
added some new functionality to the tiny .NET application

SQLAgent
added a tweak to accommodate invalid history data

BACKUP
fixed an issue with calculating Minutes


20220220
========

BACKUP
modified filtering functionality for result sets

Databases
added a new result set for transaction log files


20220224
========

Storage
introduction of a new tool (29)


20220303
========

Storage
added a Rows column to result set 5
added a Rows column to result set 6
added a new result set for any row-overflow (ROV) data
added a new result set for a summary of usage by table


20220316
========

ForeignKeys
introduction of a new tool (30)

Trimmer
introduction of a new tool (31)


20220320
========

PrimaryKeys
introduction of a new tool (32)


20220322
========

BACKUP
fixed an issue that improperly limited BACKUP summary


20220402
========

IndexNeedsPlus
added filtering to improve performance

SQLFacts
added is_lvtor column to result sets
added is_ofsk  column to result sets

Browse
added is_lvtor column to result set
added is_ofsk  column to result sets

Indexer
Indexer_SQLCode
added OPTIMIZE_FOR_SEQUENTIAL_KEY

PrimaryKeys
added OPTIMIZE_FOR_SEQUENTIAL_KEY


20220410
========

Features
introduction of a new tool with three variants (33)
Features_2008
Features_2014
Features_2016

Indexer
Indexer_Formats
added a new variant for listing indexes in less-commonly-used formats

Indexer
Indexer_Examine
added filtering to some result sets to simply exclude temporal tables

SQLFacts
made adjustments to Questionable Indexes to correspond with Indexer_Examine


20220417
========

Logger
introduction of a new tool (34)

Features
Features_2005
added a new variant

Features
Features_2008
added a new result set for table types for table-valued parameters


20220422
========

Browse
added two columns to Foreign Keys / Parents
added two columns to Foreign Keys / Children

SQLFacts
added two columns to Foreign Keys
added a new result set for same object name in different schemas

Features
Features_2005
added a new result set for database snapshots

Databases
added filtering to some result sets to simply exclude database snapshots


20220430
========

WaitingRoom
introduction of a new tool (35)

Sessions
made small changes not affecting functionality

Databases
added a Log_Wait column to result set 1
added a new result set for more log file information

MetricsNow
added some disabled SQL code to facilitate saving the result sets


20220505
========

INCLUDE
introduction of a new tool (36)


20220522
========

QueryIndexes
introduction of a new tool (37)

INCLUDE
added optional filtering parameters
added exclusion for anything beyond current database
added a new result set for ordering over table/index
added a new result set for existing covering indexes (disabled)

Blocking
adjusted formula for extracting single SQL statement

IndexNeeds
adjusted formula for extracting single SQL statement

IndexNeedsPlus
adjusted formula for extracting single SQL statement

QueryHistory
adjusted formula for extracting single SQL statement

Resources
adjusted formula for extracting single SQL statement

Sessions
adjusted formula for extracting single SQL statement

WaitingRoom
adjusted formula for extracting single SQL statement


20220530
========

INCLUDE
added Nature column as a short form of key index information
added index filter as an available column
excluded indexes for all primary keys and unique constraints

QueryIndexes
added Nature column as a short form of key index information
added index filter as an available column
added message for edition/version and last restart date/time


20220620
========

Planner
introduction of a new tool (38)


20220718
========

SQLFacts
added support for indexes on views

Browse
added support for indexes on views

GenerateSQL
GenerateSQL_All
added support for indexes on views

GenerateSQL
GenerateSQL_2
added support for indexes on views

PrimaryKeys
added support for indexes on views

Databases
added RCSI column to indicate RCSI setting

Statistics
added support for indexes on views

QueryIndexes
added support for indexes on views

IndexHistory
added support for indexes on views

IndexActivity
added support for indexes on views

INCLUDE
added support for indexes on views

Indexer
Indexer_Examine
added support for indexes on views

Indexer
Indexer_Columns
added support for indexes on views

Indexer
Indexer_SQLCode
added support for indexes on views
added comments for easily scanning by table
extended list of columns for INCLUDE clause
fixed an issue with a missing comma in a long list of columns for INCLUDE clause

Janitor
Janitor_Tables
added support for indexes on views

Janitor
Janitor_Indexes
added support for indexes on views

Storage
added support for indexes on views


20220820
========

QueryTracker
introduction of a new tool (39)

QueryHistory
changed default for @Seconds metric to CPU time

Planner
changed default for @Seconds metric to CPU time

IndexHistory
added Partitions and Compression as available columns

IndexActivity
added Partitions and Compression as available columns

IndexNeeds
added filtering to exclude system databases

SQLFacts
addressed issue involving IDENTITY information and dropped columns

Browse
addressed issue involving IDENTITY information and dropped columns

GenerateSQL_2
addressed issue involving IDENTITY information and dropped columns

GenerateSQL_All
addressed issue involving IDENTITY information and dropped columns

GenerateSQL_IN
addressed issue involving IDENTITY information and dropped columns

GenerateSQL_UP
addressed issue involving IDENTITY information and dropped columns

Features_2016
addressed issue involving IDENTITY information and dropped columns


20220822
========

QueryTracker
removed CostEstimate column because it was usually incorrect


20220828
========

Threshold
introduction of a new tool (40)

QueryTracker
added CostEstimate column back, using a more stable approach


20220910
========

Threshold
added feature to use given percentile for threshold values
added result set (initially disabled) for threshold values
rearranged columns, moved two columns

QueryTracker
rearranged columns, moved two columns

IndexNeeds
extended filtering to exclude tempdb

IndexNeedsPlus
extended filtering to exclude tempdb


20220922
========

Threshold
improved method of loading plan cache items
improved method of gathering cost estimates

QueryTracker
improved method of gathering cost estimates

AGLatency
added filtering for databases being primary replicas


20221002
========

Sessions
added a new result set for memory usage

Janitor
Janitor_Tables
added optional filtering by schema/object

Janitor
Janitor_Indexes
added optional filtering by schema/object

Indexer
Indexer_SQLCode
added optional filtering by schema/object

IndexHistory
added optional filtering by schema/object

IndexActivity
added optional filtering by schema/object

Statistics
added optional filtering by schema/object

IndexNeeds
added @Benefit filter for 2019 result set


20221010
========

Snooper
introduction of a new tool with three variants (41)
Snooper_memory
Snooper_tempdb
Snooper_tempdb2


20221030
========

SQLFacts
adjusted a data type for greater compatibility

Browse
adjusted a data type for greater compatibility

Storage
adjusted a data type for greater compatibility

Search
Search_Fast, disabled block of code to search within SQL Server Agent job steps
Search_Wild, disabled block of code to search within SQL Server Agent job steps


20221120
========

Yikes! We made a foolish rookie mistake with UPDATE in the Planner tool, and we failed to catch it until now.

Planner
fixed an issue that caused all counts to be incorrect

Threshold
added a Per_Hour column for executions

QueryHistory
added a Per_Hour column for executions

QueryIndexes
added a Per_Hour column for executions

QueryTracker
added a Per_Hour column for executions
changed calculation for Percent column

Databases
added more database properties to the first result set

Search
Search_Fast, added create_date and modify_date as optional columns
Search_Wild, added create_date and modify_date as optional columns


20221224
========

SQLFacts
fixed an issue with division by zero for an empty database

Storage
fixed an issue with division by zero for an empty database
added an is_lvtor column to result set 8
added an is_lvtor column to result set 9

Threshold
created two variants to replace the original tool, Threshold_routine and Threshold_ad_hoc


20230116
========

NOTE: Many tools were adjusted to exclude Microsoft system objects. The change should not affect other functionality.

NOTE: A few tools were adjusted to exclude temporal history tables. The change should not affect other functionality.

Tables
introduction of a new tool (42)

IndexActivity
fixed an issue with pulling DMV data
rearranged columns in the result set

IndexNeeds
rearranged columns in the result set for SQL Server 2019 or newer

IndexNeedsPlus
replaced all query logic
replaced all result sets

QueryTracker
improved parsing of execution plans

Threshold
Threshold_routine
improved parsing of execution plans

Threshold
Threshold_ad_hoc
improved parsing of execution plans


20230118
========

IndexNeeds
changed generated index names to a constant value
fixed a filtering issue in the final (2019) query


20230122
========

NOTE: Many tools were adjusted to DROP any existing temporary tables before trying to (re)create them.

Tables
added a definition for the temporal column
fixed an issue with an aggregation warning


20230130
========

Bufferin
changed to include nonclustered indexes
added default focus on current database
added a cached page Percent_Full column


20230205
========

Logger
adjusted model stored procedure

Browse
added 5 result sets for a table
added 2 result sets for a routine
adjusted and rearranged result sets


20230213
========

Statistics
renamed and rearranged columns in the result sets


20230218
========

QueryHistory
renamed and rearranged columns in the result sets

QueryIndexes
renamed and rearranged columns in the result sets

QueryTracker
renamed and rearranged columns in the result sets

Threshold
Threshold_routine
renamed and rearranged columns in the result sets

Threshold
Threshold_ad_hoc
renamed and rearranged columns in the result sets


20230310
========

NOTE: Many tools were adjusted to address a potential issue with clustered index key column order.

Statistics
added a new variant, Statistics2, to evaluate uniformity of histogram steps (find jagged distributions)
added a new variant, Statistics3, to evaluate size of final histogram step  (find ever-increasing keys)


20230408
========

NOTE: Many tools were adjusted to address a potential issue with collations other than default US.


20230428
========

Routines
introduction of a new tool (43)

Tables
added a Layer column for hierarchy


20230502
========

SQLFacts
SQLFacts.exe
refreshed the tiny .NET application
added flexibility and functionality


20230618
========

Tables
added Instance Collation to Messages tab
added Database Collation to Messages tab

Routines
added Instance Collation to Messages tab
added Database Collation to Messages tab

Databases
added Instance Collation to Messages tab
added mismatch indicator to collation_name column
added a Compatibility column for compatibility_level

Sessions
added transaction_isolation_level as an available column (trans_level)

Locksmith
added transaction_isolation_level as an available column (trans_level)


20230808
========

SQLFacts
SQLFacts.exe
increased connection timeout values

Compressor
introduction of a new tool (44)

IndexHistory
moved a small piece of code for better uniformity across tools

IndexActivity
moved a small piece of code for better uniformity across tools


20250405
========

NOTE: Many tools were adjusted to recognize SQL Server 2025.

Deadlocks
reduced excessive trimming of SQL code string


20250425
========

Validator
introduction of a new tool (45)

IndexesForDRI
introduction of a new tool (46)

SQLFacts
modified ORDER BY for Foreign Keys

Indexer
Indexer_Columns
added result set (initially disabled) for identifying certain potential column data type changes


