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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:30:15+00:00 2026-05-16T14:30:15+00:00

As I was coding a php page building a MySQL request according to GET

  • 0

As I was coding a php page building a MySQL request according to GET parameters, I was wondering if MySQL does any kind of reorganization of WHERE tests in a request, or if it just takes them as they come.

For example, if I execute this request:

SELECT * FROM `table` t WHERE (SELECT `some_value` FROM `another_table` u WHERE `t.id` = `u.id` LIMIT 1) = 10 AND `a_boolean` = 1;

Obviously the second test is faster and executing it first would filter a lot of entries, so there would be less subrequests to do for the other test.
So, does MySQL reorganize the tests according to which one is faster/would filter the most entries, or does it just execute them in the given order?

  • 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-16T14:30:15+00:00Added an answer on May 16, 2026 at 2:30 pm

    Yes, MySQL (and any SQL server) makes a plan before getting to work, and tries to take the fastest approach possible. Explain gives some information on how MySQL handles the query.

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

Sidebar

Related Questions

I am coding in php, attempting to get the start\end dates and times for
I'm building a PHP/MySQL application and I'm running into a problem with my create
While I know PHP extremely well, I was wondering if there is any frameworks
I just start coding in PHP, i wrote my first php + mysql program
This is about RAW php coding. I have a page - config.php and there
I just finished coding my first jquery ajax call page. It calls a php
I'm building a website to learn coding. I have a claim.php which is a
I'm making a php page to draw information from a mysql database, and before
A long shot but here's hoping someone has some experience coding PHP hooks for
Just to give a little background: I'm using Dreamweaver CS5 for coding php, XAMPP

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.