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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:26:41+00:00 2026-05-11T06:26:41+00:00

After much work I finally got a rather complicated query to work very smootly

  • 0

After much work I finally got a rather complicated query to work very smootly and return results very quickly.

It was running well on both dev and testing, but now testing has slowed considerably. The explain query which takes 0.06 second on dev and was about the same in testing is now 7 seconds in testing.

The explains are slightly different, and I’m not sure why this would be The explain from dev

 -+---------+------------------------------+------+------------------------------ ---+ | id | select_type | table      | type   | possible_keys           | key  | key_len | ref                          | rows | Extra    | +----+-------------+------------+--------+-------------------------+------------ -+---------+------------------------------+------+------------------------------ ---+ |  1 | PRIMARY     |  | ALL    | NULL                    | NULL  | NULL    | NULL                         |    5 |    | |  1 | PRIMARY     | tickets    | ref    | biddate_idx             | biddate_idx  | 7       | showsdate.bid,showsdate.date |   78 |    | |  2 | DERIVED     | shows      | ALL    | biddate_idx,latlong_idx | NULL  | NULL    | NULL                         | 3089 | Using temporary; Using fileso rt | |  2 | DERIVED     | genres     | ref    | bandid_idx              | bandid_idx  | 4       | activehw.shows.bid           |    2 | Using index    | |  2 | DERIVED     | artists    | eq_ref | bid_idx                 | bid_idx  | 4       | activehw.genres.bid          |    1 | Using where    | +----+-------------+------------+--------+-------------------------+------------ 

and in the testing

 | id | select_type | table      | type   | possible_keys           | key         | key_len | ref                          | rows   | Extra                                        | +----+-------------+------------+--------+-------------------------+-------------+---------+------------------------------+--------+----------------------------------------------+ |  1 | PRIMARY     |  | ALL    | NULL                    | NULL        |    NULL | NULL                         |      5 |                                              | |  1 | PRIMARY     | tickets    | ref    | biddate_idx             | biddate_idx |       7 | showsdate.bid,showsdate.date |     78 |                                              | |  2 | DERIVED     | genres     | index  | bandid_idx              | bandid_idx  |     139 | NULL                         | 531281 | Using index; Using temporary; Using filesort | |  2 | DERIVED     | artists    | eq_ref | bid_idx                 | bid_idx     |       4 | activeHW.genres.bid          |      1 |                                              | |  2 | DERIVED     | shows      | eq_ref | biddate_idx,latlong_idx | biddate_idx |       7 | activeHW.artists.bid         |      1 | Using where                                  | +----+-------------+------------+--------+-------------------------+-------------+---------+------------------------------+--------+----------------------------------------------+ 5 rows in set (6.99 sec) 

The order of the tables is different, even though the queries are exactly the same. Is this what would cause the slowdown? if so, how would I fix it? The dev is windows, testing is centOs. both running same version of mysql 5.0, and like I said, testing was running perfectly and I haven’t made any structural changes to the database.

I ran mysqlcheck and all tables came back ok.

  • 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. 2026-05-11T06:26:42+00:00Added an answer on May 11, 2026 at 6:26 am

    The first plan doesn’t use index on shows.

    If you are sure this index will help you, force it:

    SELECT ... FROM ..., shows FORCE INDEX (biddate_idx) , ... WHERE ... 

    Meanwhile, collect statistics for your tables.

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

Sidebar

Ask A Question

Stats

  • Questions 98k
  • Answers 98k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For a virtual machine that can emulate a ARM platform… May 11, 2026 at 7:39 pm
  • Editorial Team
    Editorial Team added an answer Check these: Is your Service user a domain account? (local… May 11, 2026 at 7:39 pm
  • Editorial Team
    Editorial Team added an answer Follow the original coding style. It is far, far better… May 11, 2026 at 7:39 pm

Related Questions

I have two issues both related to (I believe) my SQL Server setup. I
I got into a mini-argument with my boss recently regarding project failure. After three
I'm developing a LoB application in Java after a long absence from the platform
I've been trying to get this to work for days upon days and it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.