Why INSERT query 3-4 times slower than SELECT?
Solution 1:
If your RF > 1, insert operations go through a distributed transaction cycle whereby records are stored on a majority of replicas (if RF=3, then 2; if RF=4, then 3, it RF=7, then 5). However, in the case of a SELECT, the record is read from only one tablet (assuming you are retrieving 1 record).
Assuming you're selecting the same row over and over, it should be cached in memory and you should experience mostly the network latency. This will also depend on whether you're hitting the node that has the tablet-leader or not.
Solution 2:
Adding to above comments, INSERT might be slower for your use case as it needs to load the indexes, e.g. if. you have table with Unique indexes. YBDB stores these indexes as tables and it needs to insert those as well and it will get distributed/replicated to other nodes as well.