Hello!
We are researching possibility to use Yugabyte(YSQL) and found out that there is a lot of data transfered between nodes if query is executed not against leader. In our benchmarks difference is nearly 2x.
When random node is queried we have 2.3 GB/s, when leader is queried - 5.5GB/s
Query is quite simple - it reads all data by partition key
SELECT customerid, blob
FROM filters.customersdefault
WHERE tenantid = @tenantId AND partitionid = @partitionId
Is there are a way to query tablet leaders, so connection with proper host will be constructed by application?
So fаr we can obtain hash_split value and tablets per node, but can’t find how to identify leader of tablet (unless using UI at :7000).
yb_hash_code - to get hash value
yb_local_tablets - to get all tablet “ranges”
Using follower readers will be a little trade off, which I would like to avoid if possible.
It’s sad that there is no simple YSQL query for this, but at least there is a way to get this data.
Thank you!