Bizarrely high rows read when there's only 1 row in the table? #601
-
I've been trying to learn NextAuth, and opted to try out Prisma and Planetscale for the database side of things, but as I was looking into Planetscale's Insights section, I noticed that the rows read for some of the queries was weirdly high. I literally only have 1 row that exists across all of my tables, but Insights is consistently reporting rows read of over 100. This might entirely be an error on my part somewhere, I'm just not sure how there can be more rows read than exists in the table. I'm just concerned about the implications as the project scales. I apologize for any mistakes, but I'd really appreciate any advice on the matter. Here is the relevant part of my Prisma schema if that is at all helpful
The only Prisma queries that get used during the login auth flow are: ============================================== Rows returned — The total number of rows fetched by a SELECT statement. This includes all times the query has run in the displayed time frame. In summary, the number I was reading under Rows read, was the total number of rows that specific query has read in the past 24 hours, which makes significantly more sense. For some reason I thought it was reporting that a single query read more rows than exists on the table, which was NOT what was happening. If someone can reconfirm my thought process, this discussion can be marked closed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, correct. The column to look at for inefficient queries is: |
Beta Was this translation helpful? Give feedback.
Yes, correct. The column to look at for inefficient queries is:
Rows read/rows returned
.