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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:18:30+00:00 2026-05-20T15:18:30+00:00

Hey Guys, I am doing a social networking site that requires a good bit

  • 0

Hey Guys, I am doing a social networking site that requires a good bit of queries. I am using 1 query that has a IN() function in it. I am wondering if this requires a full DB scan. I am not sure of any other way to get the same results.

Example Table:

ID | NAME | AGE
05 | Quinton | 25
22 | Stevey | 33
78 | Rebecca | 22
90 | Michael | 26

Query: "SELECT * FROM users WHERE id IN(05,78) ORDER BY id DESC LIMIT 0,2"

Is this the most efficient way to get a list of users that are in a array? (using PHP)

  • 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-20T15:18:31+00:00Added an answer on May 20, 2026 at 3:18 pm

    In general IN does not need a table scan. If you have an index on the id column MySQL will be able to use that index. But when you have only 4 rows in your table it is usually fastest to perform a table scan so when testing on a small amount of data you may find that the index is not being used until you insert more data.

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

Sidebar

Related Questions

Hey guys im a beginner in python and im doing a numberpad that shows
Hey guys so, im doing this form with a input that will contain the
Hey guys (and gals) I'm having a problem using Assembly GetExportedTypes() in .NET 4.0.
Hey guys am having a bit of problems with my jQuery, I have all
Hey guys I am doing a Database Manager proyect and I am not able
Hey guys i dont know what i'm doing wrong here. www.example.com/data/stuff1/stuff2/stuff3 to www.example.com/anything.php?par1=data&&par2=stuff1/stuff2/stuff3 And
Hey guys. I have a method that gets called each second which I want
Hey guys I have a bean that comes back and one of the properties
Hey guys, I'm doing an AJAX POST call - but with FireBug you can
hey guys, i wonder what i'm doing wrong. index.html <script src=swfobject/swfobject.jstype=text/javascript></script> <div class=post> <script

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.