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

  • Home
  • SEARCH
  • 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 8620323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:33:12+00:00 2026-06-12T06:33:12+00:00

If I’ve a statement: select .. from .. where condition; And I know beforehand

  • 0

If I’ve a statement:

select .. from .. where condition;

And I know beforehand the maximum number of times the condition can be false. How can I tell MySQL this number to increase performance? So that after the condition has been false that many times (while selecting the records), MYSQL will assume the condition to be true for the rest of the records.

Edit:

I don’t know what’s missing in my question. I’ll fill up the blanks:

select * from t where c3 > c2;

Here I know beforehand that out of 50 records there are only 5 records where the condition ‘c3 > c2’ is false. Can I and should I tell MySQL this number ‘5’ to increase the performence of this select statement? So that while executing this select statement, after this condition (c3 > c2) has been falsed 5 times, MySQL will ignore this condition for the rest of the records and will select all the records from then on.

  • 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-12T06:33:14+00:00Added an answer on June 12, 2026 at 6:33 am

    The simple answer is you can’t.

    But the thing you can do in your quest for performance is smart database design and well placed indexes.

    MySQL “preformats” index columns so that it can check your where constraints against these columns very fast.

    The MySQL website ( http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html ) list a few reasons why you should use indexes of which the top two are listed below, but you should read through all of that page:

    • To find the rows matching a WHERE clause quickly.

    • To eliminate rows from consideration. If there is a choice
      between multiple indexes, MySQL normally uses the index that finds the
      smallest number of rows

    Also a simple example of how to build smarter tables could be that instead of storing the name “John Doe” in one column you could store it in two so that you can search for anyone with the last name “Doe” without splitting or doing LIKE searches.

    You should try to avoid conditions such as LIKE as these are slow and tedious no matter how you write them.

    Among the fastest columns to do logic on are integer and float columns.

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.