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

Adding xxhash Vindex #5439

Merged
merged 1 commit into from
Nov 23, 2019
Merged

Adding xxhash Vindex #5439

merged 1 commit into from
Nov 23, 2019

Conversation

harshit-gangal
Copy link
Member

Signed-off-by: Harshit Gangal [email protected]

Added XXHash 64 Bits Vindex to be used for any sql type that are primarily used as Primary Vindex i.e Numbers / Characters.

XXHash is a high quality hashing algorithm having high performance with high Avalanche effect.

Local Benchmarks:

input size runs cpu time data processing speed
8B 169129670 5.96 ns/op 1343.35 MB/s
64B 66039966 17.0 ns/op 3772.40 MB/s
512B 22085480 54.7 ns/op 9365.76 MB/s
1KB 12024784 95.8 ns/op 10433.92 MB/s
4KB 2842335 355 ns/op 11272.72 MB/s

Signed-off-by: Harshit Gangal <[email protected]>
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

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

Looks like this is a better alternative than binary_md5. Some people may eventually want a unicode_loose_xxhash eventually.

@sougou sougou merged commit f043dcc into vitessio:master Nov 23, 2019
@harshit-gangal
Copy link
Member Author

I believe it can be extended to support multi-column Vindex. As the xxHash works on bytes it is sql column type agnostic and also allow multiple bytes to be added to generate a single 64 bit hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants