Computed views - Working in Dev env but always timeouting in Prod
Hey team,
I have a view that aggregates some data. This view is working fine in Dev but timeouting in Prod, even on stores with very low dataset
App: monster-store-credit.gadget.app
Trace id: 9f91e89497dac826d74e15be8653d18d
View name: dashboardReport
15 Replies
OK I spotted few cases where it doesn't timeout:
- some of them have correct results
- other have totally inconsistent results
I'm not sure what's going on and how to debug here...
I've ran an inline view version in API playground of the one which is inconsistent => works correctly
the only difference is that in my inline view I had to explicitely give the shopId constraint in a where clause, whereas the view is called from a route that is called from the app using
useFetch
, so the view should have inherited automatically from my shop context right? (I have a correct gelly accessControl filter for the model I'm trying to fetch)
So 2 issues here for me:
- most of the time, my view is timeouting
- when it's not timeouting, it sometimes gives me consistent results, sometimes not
I can't even run a simple view like so:
It's timeouting 95% of the time 😬
Is there any known limitations about views performance?So, I'm not seeing any issues with this query, though, I can imagine that it could run for some time based on the amount of data in the order table.
How are you testing this query?
In playground
So I didn't try running your
dashboardReport
view but I ran the simple query and it worked
I'm testing in production
And the dashboardReport
view just ran extremely quickly for meYou’re testing the query on my prod env? And no timeout for you?
Yep
Wow … mhh weird. My dashboardReport is running live when my merchants goes to their app, and most of the call are timeouting
So a few things though:
- I didn't add an fields so I was returned nulls and 0s
- I ran it from the api playground, not from the frontend
The filters might be written in a way that would slow down the query a ton
Mhh can you try at least with currency parameters?
USD
Won’t match anything without currency params
Yeah, let me test
Ok, thats timing the query out
yeah
I'm asking some information from the infra team to see what the best way to test queries might be
sometimes after few retries you can get a result (with inconsistent result when within an access control context but that's another issue) - so I know it's not the view itself the issue
OK thanks Antoine, I have to AFK a while I'll catch up when I'm back
Hey, any news ?
The team is still looking into it
Looks like there's been a little bit of progress. The team is still looking into why this is slow for you
Going to mark this thread as closed. Please write a message to reopen it if you see any more issues
Do you like this answer?
​