mysql - Any way to improve this slow query? -
Its special query goes to the slow query log for me at all times in any way to improve my ability?
mov_id, mov_title, group_concat (different genres.genre_name) all_genres, mov_desc, mov_added, mov_thumb, mov_hits, mov_numvotes, mov_totalvote, mov_imdb, mov_release, side as mov_type movies left join movies.mov_id = _genres.gen_movieid left by mov_added DESC limit 0, 20 mov_id ordered by _genres.gen_catid = genres.grenre_id where mov_status = 1 and mov_incomplete = 0 and mov_type = 1 GROUP styles join _genres;
My main concern group_concat function, especially film, which I have a comma-separated list of styles associated with the put through a loop output and clickable links In relation to making.
Do you need a style name? If you can only do with genre_id, then you can join others.
What are you indexed?
You probably want
index films idx_movies (mov_added, mov_type, mov_status, mov_incomplete)
And most certainly join index
_genres create index ind_genres_movies on (making gen_mov_id, Gen_cat_id)
Comments
Post a Comment