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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:09:11+00:00 2026-06-10T18:09:11+00:00

Take the following expression: FALSE AND (expression) Will MySQL evaluate the expression or just

  • 0

Take the following expression: FALSE AND (expression)

Will MySQL evaluate the expression or just move on as soon as it sees FALSE?

Some background context– I wanted to speed up a query by doing:

JOIN... ON (indexed_column1=indexed_column2 AND non_indexed_column_a=non_indexed_column_b)

For background on why I’m doing this query see this answer

If it’s going to always evaluate non_indexed_column_a=non_indexed_column_b then no time is saved with that.

  • 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-10T18:09:13+00:00Added an answer on June 10, 2026 at 6:09 pm

    The MySQL query optimizer uses indexes whenever possible and to use the most restrictive index in order to eliminate as many rows as possible.

    So in case of your query it will always filter the records based on first indexes columns and then filter the records from non-index columns.

    Also before query execution, MySQL eliminates the code which is always going to be false (Dead Code) .

    For more details see: http://www.informit.com/articles/article.aspx?p=377652&seqNum=2

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

Sidebar

Related Questions

I was just wondering how disastrous integer overflow really is. Take the following example
please take a look at the following snippet: public IEnumerable<T> Query(Expression<Func<T, bool>> filter) {
I'm using the following expression: /^[alopinme]{5}$/ This regexp take me words from a set
In R, I have the following expression for which I would like to take
Skiena's book on Algorithm contains the following question: 1) Evaluate expression given as binary
Which conversions take place when evaluating the following expressions? char cval; int ival; float
Take the following method (written in Ruby but this question could be applied to
Take the following naive implementation of a nested async loop using the ThreadPool: ThreadPool.SetMaxThreads(10,
Take the following example, I have a class public class SomeItem { public string
Take the following : #include <stdio.h> main() { unsigned long long verybig = 285212672;

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.