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

New UUIDv7 increased performance and indexes #439

Open
aefji opened this issue Feb 10, 2024 · 2 comments
Open

New UUIDv7 increased performance and indexes #439

aefji opened this issue Feb 10, 2024 · 2 comments

Comments

@aefji
Copy link

aefji commented Feb 10, 2024

Thanks once more for the awesome work and supporting the project.

There is a new uuid v7 which combines the benefits of v4/v1, is sortable and can be used in distributed systems.

There are a lot of performance gains for indexes, for those with large queues, some of which described here:
https://medium.com/@rtawadrous/why-uuid7-is-better-than-uuid4-as-clustered-index-edb02bf70056

The implementation could solve the degraded performance we see once millions of records exist in the job table.

There is an extension with near native perf:
https://github.com/fboulnois/pg_uuidv7
and a function which you could include in the package
https://gist.github.com/kjmph/5bd772b2c2df145aa645b837da7eca74

Do you think we could have an uuid:v7 option in the next release?

@sergeyprokhorenko
Copy link

Try this too: https://github.com/VADOSWARE/pg_idkit

@eloff
Copy link

eloff commented Jul 22, 2024

I like the idea of uuidv7, it's usually superior to uuidv4 in that it's time ordered and not only does it have ~2x better insert performance with btree indices in Postgres, it also displays better cache locality too.

But you don't want to require people to install an extension like https://github.com/fboulnois/pg_uuidv7 which won't be available everywhere people run Postgres (the big cloud providers.)

This is maybe an option: https://gist.github.com/fabiolimace/515a0440e3e40efeb234e12644a6a346#file-uuidv7-sql

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

4 participants