3

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.

alyshan
  • 166
  • 4

1 Answers1

4

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

alyshan
  • 166
  • 4