Zajímalo by mě, jestli to zvládnete:
select article_id, id, article_published_date
from prediction p
where p.prediction_date = (select max(p2.prediction_date)
from prediction p2
where p2.article_id = p.article_id
)
order by article_published_date desc;
Pak použijte tyto dva indexy:
(article_published_date desc, prediction_date, article_id, id)
(article_id, prediction_date desc)
.