There is a request
SELECT articles.id, articles.name, articles.date_add, GROUP_CONCAT(DISTINCT category.name ORDER BY category.type DESC, category.name SEPARATOR ", " ) AS catname FROM articles INNER JOIN articles_categories ON articles.id = articles_categories.id_articles LEFT JOIN category ON category.id = articles_categories.id_categories GROUP BY articles.id ORDER BY articles.date_add What indexes should be created. Something I can not figure out. Sorting greatly slows down, but it is impossible without it

articles(id, date_add). And it is not clear whyarticles_categories(1) is rigidly glued, andcategory(2) by LEFT. Can you have a situation that there is a record in (1) and there is no record for it in (2)? - Mike