3 ms·
Re: server resource wastage. That's a great point -- and someone in Jeff Dean's talk asked the same question. So, the small optimization that he mentions is to
by mrjn 10y ago
Re: server resource wastage. That's a great point -- and someone in Jeff Dean's talk asked the same question. So, the small optimization that he mentions is to send the query to the replica after 2ms telling it which server it was sent to originally. Similarly, tell the main server which replica would receive the query 2ms later. Then when one of them starts to process the query, they can directly tell the other one to cancel its execution.
This trick would save a lot of repeated effort while still improving your query latency. For more, listen to Jeff Dean's talk mentioned on the blog.