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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:20:29+00:00 2026-05-11T09:20:29+00:00

I ran into a problem last week moving from dev-testing where one of my

  • 0

I ran into a problem last week moving from dev-testing where one of my queries which had run perfectly in dev, was crawling on my testing server.

It was fixed by adding FORCE INDEX on one of the indexes in the query.

Now I’ve loaded the same database into the production server (and it’s running with the FORCE INDEX command, and it has slowed again.

Any idea what would cause something like this to happen? The testing and prod are both running the same OS and version of mysql (unlike the dev).

Here’s the query and the explain from it.

 EXPLAIN SELECT showsdate.bid, showsdate.bandid, showsdate.date, showsdate.time,     -> showsdate.title, showsdate.name, showsdate.address, showsdate.rank, showsdate.city, showsdate.state,     ->  showsdate.lat, showsdate.`long` , tickets.link, tickets.lowprice, tickets.highprice, tickets.source     -> , tickets.ext, artistGenre, showsdate.img     -> FROM tickets     -> RIGHT OUTER JOIN (     -> SELECT shows.bid, shows.date, shows.time, shows.title, artists.name, artists.img, artists.rank, artists     -> .bandid, shows.address, shows.city, shows.state, shows.lat, shows.`long`, GROUP_CONCAT(genres.genre SEPARATOR     ->  ' | ') AS artistGenre     -> FROM shows FORCE INDEX (biddate_idx)     -> JOIN artists ON shows.bid = artists.bid JOIN genres ON artists.bid=genres.bid     -> WHERE  `long` BETWEEN -74.34926984058 AND -73.62463215942 AND lat BETWEEN 40.39373515942 AND 41.11837284058     ->  AND shows.date >= '2009-03-02'  GROUP BY shows.bid, shows.date ORDER BY  shows.date, artists.rank  DESC     ->  LIMIT 0, 30     -> )showsdate ON showsdate.bid = tickets.bid AND showsdate.date = tickets.date; +----+-------------+------------+--------+---------------+-------------+---------+------------------------------+--------+----------------------------------------------+ | id | select_type | table      | type   | possible_keys | key         | key_len | ref                          | rows   | Extra                                        | +----+-------------+------------+--------+---------------+-------------+---------+------------------------------+--------+----------------------------------------------+ |  1 | PRIMARY     | <derived2> | ALL    | NULL          | NULL        | NULL    | NULL                         |     30 |                                              | |  1 | PRIMARY     | tickets    | ref    | biddate_idx   | biddate_idx | 7       | showsdate.bid,showsdate.date |      1 |                                              | |  2 | DERIVED     | genres     | index  | bandid_idx    | bandid_idx  | 141     | NULL                         | 531281 | Using index; Using temporary; Using filesort | |  2 | DERIVED     | shows      | ref    | biddate_idx   | biddate_idx | 4       | activeHW.genres.bid          |      5 | Using where                                  | |  2 | DERIVED     | artists    | eq_ref | bid_idx       | bid_idx     | 4       | activeHW.genres.bid          |      1 |                                              | +----+-------------+------------+--------+---------------+-------------+---------+------------------------------+--------+----------------------------------------------+ 
  • 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-11T09:20:29+00:00Added an answer on May 11, 2026 at 9:20 am

    I think I chimed in when you asked this question about the differences in dev -> test.

    Have you tried rebuilding the indexes and recalculating statistics? Generally, forcing an index is a bad idea as the optimizer usually makes good choices as to which indexes to use. However, that assumes that it has good statistics to work from and that the indexes aren’t seriously fragmented.

    ETA:

    To rebuild indexes, use:

    REPAIR TABLE tbl_name QUICK; 

    To recalculate statistics:

    ANALYZE TABLE tbl_name; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 121k
  • 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 Try compiling to pcode and see if you still get… May 12, 2026 at 12:21 am
  • Editorial Team
    Editorial Team added an answer I assume you want to allow descendants of B to… May 12, 2026 at 12:21 am
  • Editorial Team
    Editorial Team added an answer Try CLSIDFromString. A CLSID is actually defined as: typedef GUID… May 12, 2026 at 12:21 am

Related Questions

I recently ran into a problem caused by using fstream::eof(). I read the following
Consider the following method (used in a factory method): private Packet(byte[] rawBytes, int startIndex)
I'm playing with Python Class inheritance and ran into a problem where the inherited
A project I'm working on requires serializing a data structure before shutting down and

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.