Drastic slowdowns

Hi! I'm getting crippling slow responses from Ash for simple queries. For example:
[debug] HANDLE EVENT "sort" in TalksWeb.OutlineIndexLive
Parameters: %{"field" => "title"}

[debug] QUERY OK source="outlines" db=2.9ms idle=1069.1ms
SELECT o0."id", o0."title", o0."number", o0."active?" FROM "outlines" AS o0 ORDER BY o0."title" []
[debug] HANDLE EVENT "sort" in TalksWeb.OutlineIndexLive
Parameters: %{"field" => "title"}

[debug] QUERY OK source="outlines" db=2.9ms idle=1069.1ms
SELECT o0."id", o0."title", o0."number", o0."active?" FROM "outlines" AS o0 ORDER BY o0."title" []
This is the interesting part: db=2.9ms idle=1069.1ms It's a local DB, has 0 users other than me with a couple of tabs open, and less than 200 rows in the table. I fully recompiled the entire project and tried several times just in case it was a JIT thing but I still see the same problem. Has anybody else experienced something like this?
6 Replies
ZachDaniel
ZachDaniel3w ago
So idle has nothing to do with how long the query takes Idle is how long that connection was idle before it got used How are you detecting this slowdown? Did something change that could correlate to this? Did you update recently etc?
Gonzalo Muñoz
Gonzalo MuñozOP3w ago
I found out because the page was responding way too slowly for basic stuf like opening an edit modal or sorting this table. And yes, the app has been under heavy development the past few days, but I don't think I touched the Ash part now that I think of it. Maybe it's not even an Ash problem 🤔 Could it be something about the way I'm doing UI? It's weird because everything is local. There should not be any network related issues
ZachDaniel
ZachDaniel3w ago
I'd time specific things to see 🙂 Like time your Ash calls etc
Gonzalo Muñoz
Gonzalo MuñozOP3w ago
ok will do that. any suggestions where to start? it happens basically everywhere so it's a little hard to find a suspect
ZachDaniel
ZachDaniel3w ago
I don't really know what I could suggest as I don't know your app. When you load a page I assume some set of things happen, you can time them or just drop some IO.inspects around and see where there is a weirdly large gap etc
Gonzalo Muñoz
Gonzalo MuñozOP3w ago
ok thanks. I will come back with a report if I ever find what happened so other folks can learn from my dumb architecture decisions lol

Did you find this page helpful?