Extremely high usage due to weird ordering used by drizzle
After facing a ton of read rows in planetscale, I contacted the support team, the issue seemed to be in a weird piece of the query that drizzle was performing
Basically, this query:
translates to the following sql query:
6 Replies
No Code Developers Tools - CodersTool.com
Share Code Snippets
Code snippets can improve your workflows and save time coding. Use this online tool to share code snippets.
particularly, this portion of the query seems to be problematic
for some reason, the whole row_number() thing is slowing things down, and what is causing it is
orderBy: desc(postsTable.createdAt)
I tried replacing it with
and row reads went from 20.000 to 37.Wow
Please open a GitHub issue. Let's see if we can get a fix
Sure!
If anyone is facing something similar, here is my (extremely ugly) workaround:
here are my planetscale row reads
and here's the latency