Answer the question
In order to leave comments, you need to log in
Can this query be optimized?
There is a request:
(SELECT id,category_id FROM contents where category_id=1 ORDER BY published DESC limit 4)
UNION
(SELECT id,category_id FROM contents where category_id=2 ORDER BY published DESC limit 4)
UNION
(SELECT id,category_id FROM contents where category_id=3 ORDER BY published DESC limit 4)
UNION
(SELECT id,category_id FROM contents where category_id=4 ORDER BY published DESC limit 4)
order by category_id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question