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 9148283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:13:54+00:00 2026-06-17T11:13:54+00:00

I’ve got a MySQL table with about 100,000 records. When I try to select

  • 0

I’ve got a MySQL table with about 100,000 records. When I try to select about 20 rows from this table using the primary key (an unsigned int) it takes about a second to execute. Is there any way to optimise this?

Table: films

Column          Type        Null    Default 
film_id         int(11)     No       
film_name       varchar(45) No       
film_overview   text        No       
film_tagline    varchar(150)Yes     NULL     
release_date    date        Yes     NULL     
api_id          int(11)     No       
category_id     int(11)     No      0 

Indexes on films

Keyname         Type    Unique  Packed  Column      Cardinality Collation   Null    Comment
PRIMARY         BTREE   Yes     No      film_id     110236      A           No  
api_id          BTREE   No      No      api_id      110236      A           No  
film_id         BTREE   No      No      film_id     110236      A           No  
category_id     BTREE   No      No      category_id 4           A           No  

EXPLAIN

id  select_type         table           type    possible_keys   key     key_len     ref     rows    Extra
1   PRIMARY             films           ALL     NULL            NULL    NULL        NULL    115029  Using where
2   DEPENDENT SUBQUERY  popular_films   ALL     NULL            NULL    NULL        NULL    18      Using where

QUERY

SELECT film_name FROM `films` 
  WHERE film_id in (SELECT film_id FROM popular_films); 
  • 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-06-17T11:13:55+00:00Added an answer on June 17, 2026 at 11:13 am

    Now that you’ve added the query, the answer is simple: just use a join:

    SELECT films.film_name
    FROM `films`
    JOIN popular_films
      ON popular_films.film_id = films.film_id;
    

    It looks like your popular_films table has the same structure as films, and so probably shouldn’t be a separate table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am using jsonparser to parse data and images obtained from json response. When
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace

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.