Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 286091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:36:19+00:00 2026-05-12T05:36:19+00:00

Its particular query pops up in the slow query log all the time for

  • 0

Its particular query pops up in the slow query log all the time for me. Any way to improve its efficiency?

SELECT 
    mov_id, 
    mov_title, 
    GROUP_CONCAT(DISTINCT genres.genre_name) as all_genres, 
    mov_desc, 
    mov_added, 
    mov_thumb, 
    mov_hits, 
    mov_numvotes, 
    mov_totalvote, 
    mov_imdb, 
    mov_release, 
    mov_type 
FROM movies 
LEFT JOIN _genres 
    ON movies.mov_id = _genres.gen_movieid
LEFT JOIN genres
    ON _genres.gen_catid = genres.grenre_id 
WHERE mov_status = 1 AND mov_incomplete = 0 AND mov_type = 1 
GROUP BY mov_id 
ORDER BY mov_added DESC 
LIMIT 0, 20;

My main concern is in regard to the group_concat function, which outputs a comma separated list of genres associated with the particular film, which I put through a for loop and make click-able links.

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:36:19+00:00Added an answer on May 12, 2026 at 5:36 am

    Do you need the genre names? If you can do with just the genre_id, you can eliminate the second join. (You can fill in the genre name later, in the UI, using a cache).

    What indexes do you have?

    You probably want

    create index idx_movies on movies 
      (mov_added, mov_type, mov_status, mov_incomplete)
    

    and most certainly the join index

    create index ind_genres_movies on _genres
      (gen_mov_id, gen_cat_id)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have had mysql query to check any particular reservations existing in database .
How can I use XPath to select a node without retrieving all of its
i want to remove a particular #keyword from a string. i dont know its
I'm trying to identify when a particular process is running, based on its arguments,
Its friday, and in local time the clock is 3.22pm, so my brain wont
I've got a query, (I'm using rawQuery() ) SELECT * FROM <table> I'm then
I'm trying to query an element and its children to find ID's that begin
I jotted down the following query which will list the index name and its
I have this query SELECT articles.*, users.username AS `user` FROM `articles` LEFT JOIN `users`
I am looking for a quick and dirty way to query the layouts files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.