-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled Page Compression by Default (#473)
When data compression is enabled post-deployment, the next DACPAC deployment will remove compression unless manual overrides are specified. This complicates deployments in large environments or in cases where the SQLWATCH database is large. From now on, all logger tables are now compressed by default. (If you have no compression enabled and are upgrading to this version, the upgrade can take a while whilst logger data is compressed)
- Loading branch information
1 parent
4ded794
commit 6c09e63
Showing
87 changed files
with
370 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 113 additions & 33 deletions
146
SqlWatch.Monitor/Project.SqlWatch.Database/SQLWATCH.sqlproj
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+4 Bytes
(100%)
SqlWatch.Monitor/Project.SqlWatch.Database/SetDacVersion.sql
Binary file not shown.
18 changes: 0 additions & 18 deletions
18
...Watch.Database/dbo/Procedures/usp_sqlwatch_config_enable_compression_sqlwatch_indexes.sql
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...lWatch.Database/dbo/Procedures/usp_sqlwatch_config_enable_compression_sqlwatch_tables.sql
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...bles/sqlwatch_logger_agent_job_history/idx_sqlwatch_logger_agent_job_history_run_date.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
create nonclustered index idx_sqlwatch_logger_agent_job_history_run_date | ||
on dbo.sqlwatch_logger_agent_job_history (run_date) | ||
with (data_compression=page) |
3 changes: 3 additions & 0 deletions
3
.../sqlwatch_logger_agent_job_history/idx_sqlwatch_logger_agent_job_history_run_date_utc.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
create nonclustered index idx_sqlwatch_logger_agent_job_history_run_date_utc | ||
on dbo.sqlwatch_logger_agent_job_history (run_date_utc) | ||
with (data_compression=page) |
4 changes: 4 additions & 0 deletions
4
...ase/dbo/Tables/sqlwatch_logger_agent_job_history/pk_sqlwatch_logger_agent_job_history.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_agent_job_history] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_agent_job_history] | ||
PRIMARY KEY CLUSTERED ([sql_instance], [snapshot_time], [sqlwatch_job_id], [sqlwatch_job_step_id], [sysjobhistory_instance_id], [snapshot_type_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...roject.SqlWatch.Database/dbo/Tables/sqlwatch_logger_check/idx_sqlwatch_logger_check_1.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create nonclustered index idx_sqlwatch_logger_check_1 | ||
on [dbo].[sqlwatch_logger_check] ([status_change]) | ||
include ([check_status]) | ||
with (data_compression=page) |
4 changes: 4 additions & 0 deletions
4
...roject.SqlWatch.Database/dbo/Tables/sqlwatch_logger_check/idx_sqlwatch_logger_check_2.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create nonclustered index idx_sqlwatch_logger_check_2 | ||
on [dbo].[sqlwatch_logger_check] ([sql_instance],[check_id]) | ||
include ([snapshot_time],[snapshot_type_id]) | ||
with (data_compression=page) |
4 changes: 4 additions & 0 deletions
4
...roject.SqlWatch.Database/dbo/Tables/sqlwatch_logger_check/idx_sqlwatch_logger_check_3.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create nonclustered index idx_sqlwatch_logger_check_3 | ||
on [dbo].[sqlwatch_logger_check] ([check_id]) | ||
include ([sql_instance],[snapshot_time],[snapshot_type_id],[check_value]) | ||
with (data_compression=page) |
4 changes: 4 additions & 0 deletions
4
...r/Project.SqlWatch.Database/dbo/Tables/sqlwatch_logger_check/pk_sqlwatch_logger_check.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_check] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_check] | ||
PRIMARY KEY CLUSTERED (snapshot_time, sql_instance, check_id, snapshot_type_id) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...atch.Database/dbo/Tables/sqlwatch_logger_check_action/pk_sqlwatch_logger_check_action.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_check_action] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_check_action] | ||
PRIMARY KEY clustered ([snapshot_time], [sql_instance], [check_id], [snapshot_type_id], [action_id]) | ||
with (data_compression=page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ase/dbo/Tables/sqlwatch_logger_disk_utilisation_database/PK_logger_disk_util_database.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_disk_utilisation_database] | ||
ADD CONSTRAINT [PK_logger_disk_util_database] | ||
PRIMARY KEY CLUSTERED ([snapshot_time],[snapshot_type_id],[sql_instance], [sqlwatch_database_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...bles/sqlwatch_logger_disk_utilisation_table/pk_sqlwatch_logger_disk_utilisation_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_disk_utilisation_table] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_disk_utilisation_table] | ||
PRIMARY KEY CLUSTERED ([snapshot_time], [sql_instance], [snapshot_type_id], sqlwatch_database_id, sqlwatch_table_id) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...SqlWatch.Database/dbo/Tables/sqlwatch_logger_disk_utilisation_volume/PK_disk_util_vol.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_disk_utilisation_volume] | ||
ADD CONSTRAINT [PK_disk_util_vol] | ||
PRIMARY KEY CLUSTERED (snapshot_time, [snapshot_type_id], [sql_instance], [sqlwatch_volume_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...dbo/Tables/sqlwatch_logger_dm_exec_requests_stats/pk_sqlwatch_logger_dm_exec_requests.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_dm_exec_requests_stats] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_dm_exec_requests] | ||
primary key clustered ([type], snapshot_time, sql_instance, snapshot_type_id) | ||
with (data_compression=page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...dbo/Tables/sqlwatch_logger_dm_exec_sessions_stats/pk_sqlwatch_logger_dm_exec_sessions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_dm_exec_sessions_stats] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_dm_exec_sessions] | ||
PRIMARY KEY clustered | ||
( | ||
[type] ASC, | ||
[snapshot_time] ASC, | ||
[snapshot_type_id] ASC, | ||
[sql_instance] ASC | ||
) | ||
with (data_compression=page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
....SqlWatch.Database/dbo/Tables/sqlwatch_logger_errorlog/idx_sqlwatch_logger_errorlog_1.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create nonclustered index idx_sqlwatch_logger_errorlog_1 on [dbo].[sqlwatch_logger_errorlog] ( | ||
keyword_id, log_type_id, sql_instance | ||
) include (log_date) | ||
with (data_compression=page) |
4 changes: 4 additions & 0 deletions
4
...ect.SqlWatch.Database/dbo/Tables/sqlwatch_logger_errorlog/pk_sqlwatch_logger_errorlog.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_errorlog] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_errorlog] | ||
PRIMARY KEY CLUSTERED (snapshot_time, log_date, attribute_id, errorlog_text_id, keyword_id, log_type_id, snapshot_type_id) | ||
WITH (DATA_COMPRESSION=PAGE) |
24 changes: 9 additions & 15 deletions
24
...e/dbo/Tables/sqlwatch_logger_errorlog.sql → ...ger_errorlog/sqlwatch_logger_errorlog.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
CREATE TABLE [dbo].[sqlwatch_logger_errorlog] | ||
( | ||
sql_instance varchar(32) not null default @@SERVERNAME, | ||
log_date datetime, | ||
attribute_id smallint, | ||
errorlog_text_id int, | ||
keyword_id smallint, | ||
log_type_id int, | ||
snapshot_time datetime2(0), | ||
snapshot_type_id tinyint, | ||
log_date datetime not null, | ||
attribute_id smallint not null, | ||
errorlog_text_id int not null, | ||
keyword_id smallint not null, | ||
log_type_id int not null, | ||
snapshot_time datetime2(0) not null, | ||
snapshot_type_id tinyint not null, | ||
record_count real --there could be many entries of the same type at the same time in the error log (especially failed logins) | ||
constraint pk_sqlwatch_logger_errorlog primary key clustered ( | ||
snapshot_time, log_date, attribute_id, errorlog_text_id, keyword_id, log_type_id, snapshot_type_id | ||
), | ||
|
||
constraint fk_sqlwatch_logger_errorlog_keyword foreign key (sql_instance, keyword_id, log_type_id) | ||
references dbo.sqlwatch_meta_errorlog_keyword (sql_instance, keyword_id, log_type_id) on delete cascade, | ||
|
||
constraint fk_sqlwatch_logger_errorlog_snapshot foreign key ([snapshot_time], [sql_instance], [snapshot_type_id]) | ||
references dbo.sqlwatch_logger_snapshot_header ([snapshot_time], [sql_instance], [snapshot_type_id]) on delete cascade | ||
); | ||
go | ||
|
||
create nonclustered index idx_sqlwatch_logger_errorlog_1 on [dbo].[sqlwatch_logger_errorlog] ( | ||
keyword_id, log_type_id, sql_instance | ||
) include (log_date); | ||
go |
4 changes: 4 additions & 0 deletions
4
...h_logger_hadr_database_replica_states/pk_sqlwatch_logger_hadr_database_replica_states.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_hadr_database_replica_states] | ||
ADD CONSTRAINT [pk_sqlwatch_logger_hadr_database_replica_states] | ||
PRIMARY KEY ([hadr_group_name],[replica_server_name],[database_name],[snapshot_time],[sql_instance],[snapshot_type_id]) | ||
with (data_compression=page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...qlWatch.Database/dbo/Tables/sqlwatch_logger_index_histogram/pk_logger_index_histogram.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_index_histogram] | ||
ADD CONSTRAINT [pk_logger_index_histogram] | ||
PRIMARY KEY CLUSTERED ([snapshot_time],[sql_instance], [sqlwatch_database_id], [sqlwatch_table_id], [sqlwatch_index_id], [sqlwatch_stat_range_id], [snapshot_type_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...tch.Database/dbo/Tables/sqlwatch_logger_index_missing_stats/pk_logger_missing_indexes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_index_missing_stats] | ||
ADD CONSTRAINT [pk_logger_missing_indexes] | ||
PRIMARY KEY CLUSTERED ([sql_instance], [snapshot_time], [sqlwatch_database_id], [sqlwatch_table_id], [sqlwatch_missing_index_id], [sqlwatch_missing_index_stats_id], [snapshot_type_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...t.SqlWatch.Database/dbo/Tables/sqlwatch_logger_index_usage_stats/pk_index_usage_stats.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE [dbo].[sqlwatch_logger_index_usage_stats] | ||
ADD CONSTRAINT [pk_index_usage_stats] | ||
PRIMARY KEY clustered ([snapshot_time], [sql_instance], [sqlwatch_database_id], [sqlwatch_table_id], [sqlwatch_index_id], [partition_id], [snapshot_type_id]) | ||
WITH (DATA_COMPRESSION=PAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.