Skip to content

Limit the online full-order case to clustered columnstore indexes - #10462

Open
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
MicrosoftDocs:livefrom
rudi-bruchez:fix/ordered-columnstore-full-order-clustered
Open

Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
MicrosoftDocs:livefrom
rudi-bruchez:fix/ordered-columnstore-full-order-clustered

Conversation

@rudi-bruchez

Copy link
Copy Markdown
Contributor

What's wrong

In ordered-columnstore-indexes.md, the "Order type" table says that ONLINE = ON and MAXDOP = 1 give a full order, for any ordered columnstore index. What's new in columnstore indexes describes the improved sort quality for ordered clustered columnstore indexes only, and that's what I measured: an ordered nonclustered columnstore index built online with MAXDOP = 1 is limited by the query workspace memory, like an offline build.

Evidence

SQL Server 2025 CU7 (17.0.4065.4), Enterprise Developer, Linux container. Fresh database, 7,805,406 rows from a heap whose physical order is unrelated to the order column. The memory grant is set with a Resource Governor workload group (REQUEST_MAX_MEMORY_GRANT_PERCENT) and read from the query_memory_grant_usage event.

-- small grant (81 MB)
CREATE CLUSTERED COLUMNSTORE INDEX cci ON dbo.T ORDER (DateHeure) WITH (ONLINE = ON, MAXDOP = 1);
CREATE NONCLUSTERED COLUMNSTORE INDEX ncci ON dbo.T (DateHeure, ContactId, TypeEvenementCd, DureeSecondes)
    ORDER (DateHeure) WITH (ONLINE = ON, MAXDOP = 1);

Observed order quality of the order column (8 to 15 segments):

Index Online, small grant Online, large grant Offline, grant equals ideal
Clustered 100 % 100 % 100 %
Nonclustered 0 % 100 % 100 %

An online nonclustered build with a large grant and an offline build that fits in memory both give a full order, so the second row of the table no longer needs ONLINE = OFF.

Change

The first row now reads "Clustered columnstore index, ONLINE = ON, and MAXDOP = 1", and the second row drops ONLINE = OFF. The paragraph after the table is left as is: #10456 corrects where an online build spills.

@prmerger-automator

Copy link
Copy Markdown
Contributor

Rudi Bruchez (@rudi-bruchez) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit a1dd868:

✅ Validation status: passed

File Status Preview URL Details
docs/relational-databases/indexes/ordered-columnstore-indexes.md ✅Succeeded

For more details, please refer to the build report.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Update the spill-location explanation to match the revised clustered online-build guidance.

1 open issue
What changed in this PR

This pull request updates the ordered columnstore index documentation to limit the online full-order guarantee to clustered columnstore indexes.

Changes:

  • Restricts the ONLINE = ON and MAXDOP = 1 full-order case to clustered columnstore indexes.
  • Removes the ONLINE = OFF requirement when the build fits in query workspace memory.
  • Leaves the accompanying spill-location explanation inconsistent with the revised guidance.
File Summary
docs/​relational-databases/​indexes/​ordered-columnstore-indexes.md Updates the order-type prerequisites for clustered online builds and memory-fitting builds. The spill-location explanation still requires correction.

Review effort: Lite

| `MAXDOP = 1`, and the data to sort fully fits in the query workspace memory | Full |
| All other cases | Partial |

In the first case when both `ONLINE = ON` and `MAXDOP = 1`, the sort isn't limited by the query workspace memory because an online build of an ordered columnstore index uses the `tempdb` database to spill the data that doesn't fit in memory. This approach can make the index build process slower due to the additional `tempdb` I/O, and requires sufficient free space in `tempdb`. However, because the index build is performed online, queries can continue using the existing index while the new ordered index is being built.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#reject: the paragraph below the table is corrected in #10456.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rudi Bruchez (@rudi-bruchez) given that there are two related changes, they should be made and published together on a single PR. Can you please close one and continue with the other?

@Court72

Copy link
Copy Markdown
Contributor

William Assaf MSFT (@WilliamDAssafMSFT)

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator Bot added the aq-pr-triaged tracking label for the PR review team label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants