List:General Discussion« Previous MessageNext Message »
From:Philip Brown Date:October 5 2001 6:34pm
Subject:RE: Bizarre query performance
View as plain text  
> Have you tried "explain"ing the two select to see where all the time is
> being spent and how the queries are optimized?

Sorry, I should have included that in my detail.

+-------+-------+---------------+---------+---------+-------+------+-------+
| table | type  | possible_keys | key     | key_len | ref   | rows | Extra |
+-------+-------+---------------+---------+---------+-------+------+-------+
| X     | const | PRIMARY,p1    | PRIMARY |       4 | const |    1 |       |
+-------+-------+---------------+---------+---------+-------+------+-------+

This is the query that takes 200ms. It performs the same regardless of the
particular table involved (all have a similar primary key), or the record
fetched.

+------+-------+----------------+----------------+---------+------+------+--
----------+
| table| type  | possible_keys  | key            | key_len | ref  | rows |
Extra      |
+------+-------+----------------+----------------+---------+------+------+--
----------+
| X    | range | ScheduledStart | ScheduledStart |       8 | NULL |   25 |
where used |
+------+-------+----------------+----------------+---------+------+------+--
----------+

This is the query that takes less than 10ms. Performance should be worse
than that
above, but it is not.

Thread
Bizarre query performancePhilip Brown5 Oct
  • Re: Bizarre query performanceRussell Miller5 Oct
    • RE: Bizarre query performancePhilip Brown5 Oct
      • Re: Bizarre query performanceRussell Miller5 Oct
        • RE: Bizarre query performancePhilip Brown5 Oct
          • Re: Bizarre query performanceRussell Miller6 Oct
            • RE: Bizarre query performancePhilip Brown6 Oct
  • Re: Bizarre query performanceBoyd Lynn Gerber5 Oct
    • RE: Bizarre query performancePhilip Brown5 Oct
      • RE: Bizarre query performanceBoyd Lynn Gerber5 Oct
  • Re: Bizarre query performanceDan Nelson5 Oct
    • RE: Bizarre query performancePhilip Brown5 Oct
      • Re: Bizarre query performanceDan Nelson5 Oct
        • Re: Bizarre query performanceBoyd Lynn Gerber6 Oct
          • RE: Bizarre query performancePhilip Brown6 Oct
            • Re: Bizarre query performanceDan Nelson7 Oct
              • Preventing Nagle with mysql (was: Bizarre query performance)Philip Brown8 Oct
                • Re: Preventing Nagle with mysql (was: Bizarre query performance)Dan Nelson10 Oct
                  • Re: Preventing Nagle with mysql (was: Bizarre query performance)Sinisa Milivojevic10 Oct