eloquent performance acting up again?
hey folks, after finally squashing that tricky relation bug we talked about last week, my app decided to throw a new tantrum. now pages are super slow, like it's trying to load the entire internet.
it seems certain eloquent queries, especially on one of my main list pages, are just taking ages to resolve. it's like watching paint dry, but with database calls.
[2023-10-27 10:30:01] local.INFO: SQL query executed: SELECT * FROM `products` WHERE `status` = 'active' AND `category_id` IN (1, 2, 3) AND `price` BETWEEN 10 AND 100 ORDER BY `created_at` DESC LIMIT 50 OFFSET 0 -- Time: 1540ms
[2023-10-27 10:30:02] local.INFO: SQL query executed: SELECT COUNT(*) FROM `products` WHERE `status` = 'active' AND `category_id` IN (1, 2, 3) AND `price` BETWEEN 10 AND 100 -- Time: 890ms
[2023-10-27 10:30:03] local.INFO: SQL query executed: SELECT `id`, `name` FROM `users` WHERE `id` IN (1, 2, 3, ...) -- Time: 320ms (for eager loading?)
anyone got any quick wins for improving eloquent performance without needing a full-blown refactor right now? i'm open to all suggestions!
thanks in advance!
0 Answers
No answers yet.
Be the first to provide a helpful answer!