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

its out of question that a dao will not hold any state. however, for
Its a simple config app with 4 checkboxes and 5 textboxes, and all values
I have a database which stores the work my staff do. One particular query
I've got a query, (I'm using rawQuery() ) SELECT * FROM <table> I'm then
I was looking at a very slow SQL query (originating from a Java app
I am using MATCH(col1,col2) AGAINST(text) query to search things fastly. But due tto its
When authoring a library in a particular namespace, it's often convenient to provide overloaded
Its possible I am just really really thick. However, looking over the SDK for
Its a .vbproj and looks like this <Project DefaultTargets=Build xmlns=http://schemas.microsoft.com/developer/msbuild/2003> <PropertyGroup> <ProjectGuid>15a7ee82-9020-4fda-a7fb-85a61664692d</ProjectGuid> all i
If its dead, is there a successor? For those who didn't know: The Network

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.