rebuild index never done ONLINE on Azure SQL ? due to EngineEdition IN (1804890536, 1872460670, 610778273, -2117995310)

Open
#319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
azure, sql
Domain
databases

Research direction

Start in usp_AdaptiveIndexDefrag.sql at the SERVERPROPERTY('EditionID') and @engineedition checks, then compare those conditions with the documented Azure SQL edition values and online index rebuild behavior. Confirm whether the current logic incorrectly disables online rebuilds and document or test the expected result for Azure SQL Database and managed instances.

Written by the indexing model from the issue text.

Description

hi,
not sure but in the code of usp_AdaptiveIndexDefrag.sql
/* Refer to http://docs.microsoft.com/sql/t-sql/functions/serverproperty-transact-sql */
IF (SELECT SERVERPROPERTY('EditionID')) IN (1804890536, 1872460670, 610778273, -2117995310)
SET @editionCheck = 1 -- supports enterprise only features: online rebuilds, partitioned indexes and MaxDOP
ELSE
SET @editionCheck = 0; -- does not support enterprise only features: online rebuilds, partitioned indexes and MaxDOP

running in Azure SQL, it will set then @editionCheck = 0; correct ?
Anf when readign this:
https://learn.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql?view=sql-server-ver17

Database Engine edition of the instance of SQL Server installed on the server.

1 = Personal or Desktop Engine (Not available in SQL Server 2005 (9.x) and later versions.)
2 = Standard (For Standard, Standard Developer, Web, and Business Intelligence.)
3 = Enterprise (For Enterprise, Enterprise Developer, Developer, and Evaluation editions.)
4 = Express (For Express, Express with Tools, and Express with Advanced Services)
5 = SQL Database
6 = Azure Synapse Analytics
8 = Azure SQL Managed Instance
9 = Azure SQL Edge (For all editions of Azure SQL Edge)
11 = Azure Synapse serverless SQL pool, or Microsoft Fabric
12 = Microsoft Fabric SQL database in Microsoft Fabric.

I have add in my script this :
/* Azure SQL Database / Hyperscale always supports online index rebuilds regardless of EditionID */
IF @engineedition IN (5, 8)
SET @editionCheck = 1;

to suppor Azure SQL

Did my understand is wrong ?

regards,
Eric

Dominant language
Jupyter Notebook
Stars
1.6k
Forks
749
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/tigertoolbox

All issues in microsoft/tigertoolbox

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.