Skip to content

(Bugfix!) Adjust date condition for data partitioning process#10302

Open
ThisUsernameWasNotTaken wants to merge 1 commit intoMicrosoftDocs:livefrom
ThisUsernameWasNotTaken:patch-1
Open

(Bugfix!) Adjust date condition for data partitioning process#10302
ThisUsernameWasNotTaken wants to merge 1 commit intoMicrosoftDocs:livefrom
ThisUsernameWasNotTaken:patch-1

Conversation

@ThisUsernameWasNotTaken

After trying the example i had to change this condition because the logical partitioning system of the sql server will sort rows into their partition this way too internally. It became obvious after spamming inserts and split commands with identical time values since the precision of datetime2 required by this example project is ambiguous for rapidly retrieved SYSDATETIME() values. Regardless of transaction safety. If too fast its gets ambiguous. ie. two identical values for two seperate calls to SYSDATETIME().

After trying the example i had to change this condition because the logical partitioning system of the sql server will sort rows into their partition this way too internally. It became obvious after spamming inserts and split commands with identical time values since the precision of datetime2 required by this example project is ambiguous for rapidly retrieved SYSDATETIME() values. Regardless of transaction safety. If too fast its gets ambiguous. ie. two identical values for two seperate calls to SYSDATETIME().
@prmerger-automator
Copy link
Contributor

@ThisUsernameWasNotTaken : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 71994f8:

✅ Validation status: passed

File Status Preview URL Details
docs/relational-databases/in-memory-oltp/application-pattern-for-partitioning-memory-optimized-tables.md ✅Succeeded

For more details, please refer to the build report.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the T-SQL sample in the In-Memory OLTP partitioning pattern article to adjust the boundary condition used when offloading rows and when creating the staging table’s CHECK constraint, aiming to avoid issues with identical datetime2 boundary values during rapid SYSDATETIME() usage.

Changes:

  • Change offload predicates from <= @splitdate to < @splitdate for both the INSERT and DELETE.
  • Change the staging CHECK constraint from so_date > @splitdate to so_date >= @splitdate.
  • Add an inline NOTE describing potential partition boundary duplication errors.

@Court72
Copy link
Contributor

Court72 commented Mar 20, 2026

@MikeRayMSFT

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 Mar 20, 2026
Copy link
Author

@ThisUsernameWasNotTaken ThisUsernameWasNotTaken left a comment

Choose a reason for hiding this comment

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

It's good enough #sign-off

@ThisUsernameWasNotTaken
Copy link
Author

#sign-off

@prmerger-automator
Copy link
Contributor

Invalid command: '#sign-off'. Only the assigned author of one or more file in this PR can sign off. @MikeRayMSFT

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.

4 participants