Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when updating incremental statistics with norecompute option #489

Open
mikedavem opened this issue Mar 2, 2021 · 0 comments
Open

Comments

@mikedavem
Copy link

Description of the issue
Update on incremental statistics fails with error NORECOMPUTE' is not a recognized UPDATE STATISTICS option.

SQL Server version and edition
Microsoft SQL Server 2017 (RTM-CU22-GDR) (KB4583457) - 14.0.3370.1 (X64) Nov 6 2020 18:19:52 Copyright (C) 2017 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Datacenter 10.0 (Build 14393: ) (Hypervisor)

Version of the script
2020-12-31 18:58:56

What command are you executing?
EXECUTE dbo.IndexOptimize
@databases = 'USER_DATABASES',
@FragmentationLow = NULL,
@FragmentationMedium = NULL,
@FragmentationHigh = NULL,
@UpdateStatistics = 'ALL',
@OnlyModifiedStatistics = 'Y',
@LogToTable = 'Y',
@MaxDOP = 4,
@execute = 'Y'
GO

What output are you getting?
For incremental statistics here the output that raises an error:
UPDATE STATISTICS [dbo].[mytable] [Imyindex] WITH MAXDOP = 4, RESAMPLE, NORECOMPUTE ON PARTITIONS(2)

Msg 155, Level 15, State 1, Line 57
'NORECOMPUTE' is not a recognized UPDATE STATISTICS option.

The command should be as follows to not trigger the above issue:

UPDATE STATISTICS [dbo].[mytable] [myindex] WITH RESAMPLE ON PARTITIONS(2), MAXDOP = 4, NORECOMPUTE;

But maybe we should also consider to add an exclusion of statistics with norecompute option ? I didn't find options for that

David

@mikedavem mikedavem changed the title Error when updating incremental statistics Error when updating incremental statistics with norecompute option Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants