2
votes
2answers
124 views

Slow MySQL query with Order and Group by

I have a query that is taking a long time to execute (1.13s). The two tables user_articles and articles have around 25,000 records. This is the query: SELECT `user_articles`.* FROM `user_articles` ...
0
votes
0answers
35 views

Group by collection_item_id and order by products.weight

SELECT `products`.* FROM `products` INNER JOIN collection_items ON products.collection_item_id = collection_items.id WHERE `products`.`product_type_id` = 1 AND (products.status = ...
1
vote
1answer
456 views

Slow complex query with group/order

I have a problem with a very important query in my application. It is very slow when adding group and order to it. So the full query is: SELECT m.id, m.title, m.title_text, ...
1
vote
0answers
181 views

MySQL GROUP BY and ORDER BY giving inconsistent results

I'm currently working with WordPress, and I've added a new meta value which is a number between 0 and 30. Zero is ignored and up to 30 need to be organised in order and only the latest (based on the ...