Why "local reads" & "local writes" metrics does not exist with YSQL?

With YCQL, we see below metrics for local reads and remote reads.
But, with YSQL we see BEGIN transactions

  1. Why yugaware metrics does not show “local read” vs “remote read” metrics for YSQL?

  2. Does YSQL query plan not include finding the shard owner? before executing the query…

It does not.

Because it’s still not possible to target the correct shard in YSQL so this metric would be random.

@dorian_yugabyte
Ok.

Using YCQL, the query plan for INSERT would consist of:
Finding shard owner,
Execute query on shard owner,
Find the replication node for that shard,
Execute the query on replication node,
Respond to client

How does YSQL query plan work?

@sham_yuga

The difference between YCQL and YSQL is where the process that you described previously actually happens currently.
In YCQL, the driver has first hand information on shard locations / leaders via the system.partitions table.
In YSQL, the driver has no special knowledge of this information at this time, so it connects to a node as directed via either the smart-driver or some other load balancing connection, and once the backend is forked on the node, it discovers this same information via a RPC call. So the backend process where the planner, optimizer and executor has this information to send the appropriate RPC calls to the correct nodes. The RPC calls are executed on the appropriate nodes and the information is returned to the node where the backend process is executing, where it is then returned to a client when the query is completed.

Alan

1 Like

@Alan_Caldera
For your point: “In YCQL, the driver has first hand information on shard locations / leaders via the system.partitions table.”

I think this token aware feature from gocql driver to remember shard locations, is yet to be supported. Below are the tickets:

https://github.com/yugabyte/yugabyte-db/projects/51#card-77428223
https://github.com/yugabyte/yugabyte-db/projects/51#card-77427628

So, any guess, How much time does it take for these tickets to get resolved?

@sham_yuga I’ve asked the assigned dev to reply on this thread.

So, any guess, How much time does it take for these tickets to get resolved?

@sham_yuga This ticket is on our roadmap and will be taken up soon since we’ve seen increased interest for this feature in recent times. After that it may take around a few weeks to get it released.