3 ms·
Interestingly, I often ask candidates about optimising a slow running db query and the majority of people jump to adding caching and very few ask if they can ru
by aidos 3y ago
Interestingly, I often ask candidates about optimising a slow running db query and the majority of people jump to adding caching and very few ask if they can run an explain or see the indexes.
- tedunangst 3y ago"I would make the slow query faster" seems too obvious an answer for an interview question.
- pphysch 3y agoThe question is usually phrased like "what would you check/do if you had a page that was taking many seconds to load".
- aidos 3y agoHaha, sure, but the very first thing you should ask when faced with a slow query is to see the “explain analyse” output. Caching, in any form, is the last thing you want to reach for because it’s always more nuanced than you anticipate. To clarify, when asking the question it’s after drilling through the layers from the frontend -> backend -> query and the actual query is on the screen along with some table metrics as a guide.