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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:17:59+00:00 2026-05-22T19:17:59+00:00

I am wondering if my theory is right here so looking for some advice

  • 0

I am wondering if my theory is right here so looking for some advice from MySQL gurus.

I have a table I have redesigned to just include various elements user SELECT queries can search against. There are many permutations on the WHERE clause and then a few permutations they could want ORDER BY.

Creating multi indexes for all is pretty much impossible as I see it and slowness can come from the ORDER BY when the table has 1 million+ rows.

My idea is to create versions of the results duplicated in other tables but use ALTER TABLE to do an ORDER BY the various ways a user can ORDER BY.

Then via application know which order the user wants and use that table accordingly. Then indexes would only be needed on the WHERE columns utilising leftmost.

Is this a reasonable way to do it to increase performance and sustainable if the tables are only updated once and copied across and when updated recopied?

Of course im making the assumption that mysql returns rows via LIMIT in the order of the table sort if no ORDER BY in the SELECT statement is declared. This would mean not needing to stick the ORDER BY in the SELECT query.

eg SELECT * FROM table_order_x WHERE x = 1 AND y = 2 AND z = 3 LIMIT 15000,25; relying on the order from the table sort.

Would this work or has anyone had to come up with something similar? I’m trying to think outside the box a bit.

  • 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-22T19:18:00+00:00Added an answer on May 22, 2026 at 7:18 pm

    this does not work this way. Order is not guaranteed in a selected list unless ORDER BY is used.

    I think a bigger problem for you to contemplate is why does the user need 1 million rows of returned data, what good does that do them? perhaps figuring a way to summarize to something useful would allow you to optimize a bit.

    (p.s. the ORDER does not occur until AFTER the result set is determined, so the entire rowset in the table is not somehow pre-ordered before the query is run)

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

Sidebar

Related Questions

i have a question about the theory here, i'm just starting a project which
I have implemented some algorithms from graph theory in C++. My teacher wants us
I just read some stuff about the theory behind 3d graphics. As I understand
Wondering if someone could help me. I have next to no knowledge with Ajax,
Wondering what I'm missing here. Relatively new to C and iOS development, so please
Wondering if there is any way to get the lambda expressions that result from
wondering if some of you know what javascript framework facebook is using ? Thanks
I was wondering if there was any tutorial that introduces 3D Graphics theory while
High, I am wondering if anyone could give me some input on a design
I am having difficulty deleting rows from my database. I have a delete button

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.