-
Notifications
You must be signed in to change notification settings - Fork 146
Description
As time goes on, SQL server releases add or remove certain features. Similarly, this sink has many defaults that exist purely for backwards-compatibility reasons, despite learning later that other defaults would be better. For example, the Level
Standard Column defaults to 128 bytes when 12 would be adequate (#146), or the use of a DateTime
column for TimeStamp
rather than the superior SQL 2008 DateTimeOffset
type.
The PR I'm working on consolidates most of these defaults into the ColumnOptions
constructor, and I'm considering an override (not in the same PR) that accepts an enumeration which maps to groups of default values.
public enum MSSqlSinkFeatureLevel
{
BackwardsCompatible, // the default, whatever the sink does today
OptimizedDefaults, // baseline SQL, better indexing and column sizes
SQL2008, // DateTimeOffset TimeStamp column
SQL2017 // CCI supports max-length character data
}
var colOpts = new ColumnOptions(MSSqlSinkFeatureLevel.OptimizedDefaults);
The most important aspect of this, in my opinion, would be OptimizedDefaults
which are performance-oriented without getting into changes that require a specific version of SQL Server:
- omit the
Id
column (see benchmarks) - default
Level
to 12 characters instead of 128 - include the
LogEvent
Standard Column by default instead ofProperties
- set
DisableTriggers
totrue
by default
While of less importance, this could also help inform configuration validation which could reduce support questions. For example, clustered columnstore indexing only supports max
length character data with SQL 2017 or later. If this index type was chosen but the feature-level didn't map to SQL 2017, an exception could be thrown. When SQL 2017 is selected the max
length would be allowed.
Perhaps we can start a discussion about how these settings would impact the defaults, other possible levels, or whether this is just unnecessary noise (I'm thick-skinned, it's fine). I'm even strongly tempted to suggest a breaking change by making OptimizedDefaults
the default (the default defaults?) and anyone who is truly tied to backwards-compatibility can explicitly specify that level if necessary.
Ideas?