with below query i'm getting the results that i want but it's quite slow taking nearly 0.2 seconds (on an i5 machine). Is there a more optimized way to get the same results.
Basically this query fetches the last 20 rows in the table and shows only one row per yzr.name and orders by yzr.favorite_count
SELECT gzt.name AS gazete,
yz.*,
yzr.name,
yzr.gazete_id,
yzr.yazar_image_link,
yzr.favorite_count,
DATE_FORMAT(tarih,'%d.%m.%Y') As formatted_tarih
FROM yazar AS yzr
INNER JOIN yazi yz ON yzr.id=yz.yazar_id
INNER JOIN gazete gzt ON yzr.gazete_id = gzt.id
GROUP By yzr.name
ORDER BY yzr.favorite_count DESC
LIMIT 20 OFFSET 0