Skip to content

Adding xxhash Vindex#5439

Merged
sougou merged 1 commit intovitessio:masterfrom
harshit-gangal:xxhash
Nov 23, 2019
Merged

Adding xxhash Vindex#5439
sougou merged 1 commit intovitessio:masterfrom
harshit-gangal:xxhash

Conversation

@harshit-gangal
Copy link
Copy Markdown
Member

Signed-off-by: Harshit Gangal harshit.gangal@gmail.com

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 <harshit.gangal@gmail.com>
Copy link
Copy Markdown
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
Copy Markdown
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