Is there any good reading on how YB implements range queries over hash-partitioned data? I'm curious because this is a hard problem to solve (yes, even with a good solution, it's generally not advisable to do this query...)
YugabyteDB internals on range queries over hash-partitioned tables
22 Views Asked by dh YB At
1
There are 1 best solutions below
Related Questions in YUGABYTEDB
- TABLET_DATA_TOMBSTONED in YugabyteDB
- Difference in primary-key column order in YugabyteDB
- YugabyteDB Can't assign requested address
- Is there a easy way to run yugabyte db in local (mac os) with python3?
- Catalog Version Mismatch: A DDL occurred while processing this query error when refreshing multiple materialized views in YugabyteDB
- Flyway migration using Yugabyte JDBC Smart Driver?
- How YugabyteDB handles conflict between regions in multi-region replication
- YugabyteDB internals on range queries over hash-partitioned tables
- Bidirectional asynchronous replication with 3 clusters in YugabyteDB
- YugabyteDB CDC compared to PostgreSQL logical replication
- How to access database running on WSL2 from Windows
- YugabyteDB 'NoneType' object has no attribute 'group'
- problem yugabyte works on the command prompt but not for PGAdmin
- Yugabyte DB how to scale up disk storage size
- YugaByteDB tablet implementation
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
When you are using hash sharding, a range query on the shard key will result in a scatter/gather type query as there is no way to know what tablets to route the queries to. As a general rule, if you are planning on doing a lot or range queries on the data, consider range based sharding instead. Designing a proper range based shard key does require a lot of considerations in order to avoid data imbalances and hot spots. There is a blog article here on how we chose our sharding strategies: https://www.yugabyte.com/blog/four-data-sharding-strategies-we-analyzed-in-building-a-distributed-sql-database/#google-spanner-and-hbase-range-sharding
One solution could be to
union allall possible hash codes (from 0 to 65535) because where yb_hash_code(id)=0 is pushed down to get to the right tablet and the range of hash. But that would do 65536 calls which will not be faster.When you do hash sharding, the hash is at the start of the primary key (the key in rocksdb) https://docs.yugabyte.com/preview/architecture/docdb-sharding/sharding/#hash-sharding