Open agjohnson opened 2 weeks ago
Taking a quick look at it, I'd say we need an index for this filter
Filter: (((builds_version.type)::text <> 'external'::text) OR (builds_version.type IS NULL))
If I understand correctly, there is when it takes the most time.
Do you know what's the code that executes this query? @agjohnson
I don't, at least not without looking into this more. I wouldn't be surprised if it ended up being triggered from the templates. I wasn't able to replicate this locally, so prod might be the easiest place to try to debug this more.
New Relic might be most helpful, it can probably help align the code and query.
Note: I got this from SQL tab debug toolbar.
I also just noticed a similar really slow page load (22s) on the version listing view:
https://app.readthedocs.org/projects/test-builds/?slug=timetest&privacy=&visibility=&sort=
Not sure if that is related yet.
Interesting, but I expected this to fail to load, but it was instantaneous:
https://app.readthedocs.org/projects/test-builds/builds/?version__slug=timetest
I also just noticed a similar really slow page load (22s) on the version listing view:
Wow! It takes 34s in my case 💣
It looks like it's the build or version query on the project listing now. If you look at the SQL queries in the prod debug instance, you'll see a couple build queries taking the most time now.
Here's an explain: