3 ms·
At one previous gig we had a product-god query similar to what you're describing, which was the source of neverending sorrow. Eventually, the solution was to wr
by marktangotango 12y ago
At one previous gig we had a product-god query similar to what you're describing, which was the source of neverending sorrow. Eventually, the solution was to write and schedule a stored procedure that built a 'current_product' table with essential fields. Products and catalogs weren't updated that frequently, so it ran nightly, or could be run on demand. Performance increase was immense.
- vinceguidry 12y agoMy problem was that there was so much baked in logic that I had to trace through the codebase to figure out, and even so, I was getting lots of incorrect results for months until I'd worked all the issues out. Even now sometimes my boss will be like, "there's bad data in the feed, can you check the query?" Most of the time it's bad data, but every time I have to load the damn query up in SequelPro and make sure it's doing its job. I dread the day when I actually have to understand what it's doing again.