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

feat: uuid function from v4 to v7 #16827

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

BohuTANG
Copy link
Member

@BohuTANG BohuTANG commented Nov 13, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Overview

Change UUID functions(GEN_RANDOM_UUID/UUID)output format from v4 to v7 for improved performance and ordering

Why v7 over v4?

  • Time-ordered: v7 includes timestamp, making IDs chronologically sortable
  • Uniqueness: Same uniqueness guarantees as v4 with added time component
  • Sequential: Improves database insert performance vs random v4 values

Example

Before (v4): 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d (random)
After (v7): 018df296-2bcd-7000-9876-000000000000 (time-ordered)

Impact

  • No changes needed for existing v4 UUID usage
  • New IDs will be sortable by creation time

fixes: #16818

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Existing tests coverd

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Nov 13, 2024
@BohuTANG BohuTANG requested a review from b41sh November 13, 2024 03:05
@BohuTANG BohuTANG marked this pull request as ready for review November 13, 2024 03:05
@BohuTANG BohuTANG merged commit 80c8cf6 into databendlabs:main Nov 13, 2024
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: UUID V7
2 participants