NikoNeugebauer / CISL

Columnstore Indexes Scripts Library
Apache License 2.0
179 stars 54 forks source link

Extended Event Setup for 2017 has errors. #28

Open RyderOfTheVeil opened 5 years ago

RyderOfTheVeil commented 5 years ago

Do you want to request a feature or report a **bug?**

Two Bugs in setup_all_extended_events.sql in the 2017 Folder (Columnstore\CISL-master\CISL-master\SQL-2017\Extended Events).

What is the current behavior?

Item 1:

States that the version of SQL Server is not correct. This is due to the following code:

-- Ensure that we are running SQL Server vNext if substring(@SQLServerVersion1,1,CHARINDEX('.',@SQLServerVersion1)-1) <> N'13' --This should be 14 not 13 for all of the checks (looks like there are 8 in total). begin set @errorMessage1 = (N'You are not running a SQL Server vNext. Your SQL Server version is ' + @SQLServerVersion1); Throw 51000, @errorMessage1, 1; END

Once I got that fixed I ran into:

Item 2: The event name, "sqlserver.clustered_columnstore_index_rebuild", is invalid, or the object could not be found

I looked through the events for 2017 and didn't find this one. I don't know if somehow I'm missing it or it has changed? I did find 'columnstore_index_rebuild', just no 'clustered' version in 2017.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via http://sqlfiddle.com/

Execute the setup_all_extended_events.sql from the 2017 folder (Columnstore\CISL-master\CISL-master\SQL-2017\Extended Events) on a SQL Server 2017 instance. (I'm currently running 14.0.3076.1)

What is the expected behavior? Item 1: Pass when version 14 is installed. Item 2: I'm not sure if there is an equivalent or not. If there is, then that would get setup as an event.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?

Affects version 14 (SQL 2017). OS is Windows Server 2019. I haven't used it on any other versioning.

Thank you for these tools and your blog posts. They have been immensely educational. Looking forward to your book.

RyderOfTheVeil commented 5 years ago

After I had a closer look at the object descriptions of the two Events (clustered_columnstore_index_rebuild (SQL2016) and columnstore_index_rebuild (SQL 2017)) I've concluded that "columnstore_index_rebuild" is the equivalent in 2017.

"Occurs when columnstore index on the table was rebuilt. This event is raised three times for ALTER index rebuild operation on CCSI and once for NCCSI. For CCSI the event is raised when the operation takes lock on index rebuild resource, when lock is taken on the table, and when S lock on the table is upgraded to SCH_M lock to switch indexes in metadata. For NCCSI it is raised when SCH_M lock is taken on the table."