performance - MySQL - INNER JOIN - take only the last ID from the second table -
i need query 2 tables in mysql database. here short overview: 2 tables: articles , article_logs. have somethink 2700 articles , each article can have 20 50 logs. display each article last log date. problem query takes forever executed.
i trying somethin that:
select articles.id, article_logs.date articles left join ( select max(id), hash_key, date logs group id ) c on article.hash_key = c.hash_key
do have idea on how in proper , efficient way.
thank in advance.
maybe can try this:
select a.id, (select max(l.date) logs l l.hash_key = a.hash_key) date articles
Comments
Post a Comment