How would I see how many rows were scanned in my query? Im using LIMIT so i know how many rows are going to be returned but i'd like to see how many rows were scanned.
How would I see how many rows were scanned in my query? Im using LIMIT so i know how many rows are going to be returned but i'd like to see how many rows were scanned.
You can use EXPLAIN to analyze the query.
Depending on how you've set up your table and your query the estimated scanned row count can vary a lot.
There is a good example in the CockroachDB docs about the benefits of using keyset pagination and demonstrating the performance using EXPLAIN
See: https://www.cockroachlabs.com/docs/stable/pagination.html#keyset-pagination