MySQL Forums
Forum List  »  Performance

Re: Query Takes Longer Each Time Its Run
Posted by: Rick James
Date: February 01, 2011 12:38AM

Before submitting the bug, please correct one terminology:
"udf" -> "Stored function"

You have "stored routines"
http://dev.mysql.com/doc/refman/5.1/en/stored-routines.html
A udf is something else:
http://dev.mysql.com/doc/refman/5.1/en/adding-udf.html

I got a consistent time with:
mysql> SELECT @@version;
+------------------+
| @@version        |
+------------------+
| 5.1.30-community |
+------------------+
mysql> SHOW VARIABLES LIKE '%buffer_size';
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| bulk_insert_buffer_size | 8388608  |
| innodb_log_buffer_size  | 2097152  |
| join_buffer_size        | 131072   |
| key_buffer_size         | 57671680 |
| myisam_sort_buffer_size | 71303168 |
| preload_buffer_size     | 32768    |
| read_buffer_size        | 65536    |
| read_rnd_buffer_size    | 262144   |
| sort_buffer_size        | 262144   |
+-------------------------+----------+
mysql> SHOW TABLE STATUS LIKE 'records'\G
*************************** 1. row ******
           Name: records
         Engine: MyISAM
        Version: 10
     Row_format: Fixed
           Rows: 626
 Avg_row_length: 17
    Data_length: 10642
Max_data_length: 4785074604081151
   Index_length: 50176
      Data_free: 0
 Auto_increment: 3911876
I don't know if any of those VARIABLES are relevant; what do you have?

On an unrelated topic; these are quite redundant:
KEY `ix_unpaidhours` (`UserID`),
KEY `ix_userid` (`UserID`),
KEY `idx_xhours` (`UserID`),
KEY `idx_recordalerts` (`UserID`),
KEY `idx_usertimeclass` (`UserID`)

I got consistent times for running it.



Edited 1 time(s). Last edit at 02/01/2011 12:39AM by Rick James.

Options: ReplyQuote


Subject
Views
Written By
Posted
4007
January 26, 2011 02:59PM
1535
January 27, 2011 02:35PM
1616
January 27, 2011 10:59PM
2061
January 28, 2011 01:38PM
1396
January 30, 2011 07:20PM
1451
January 31, 2011 01:22AM
1556
January 31, 2011 01:25AM
Re: Query Takes Longer Each Time Its Run
1401
February 01, 2011 12:38AM
1520
February 01, 2011 12:56AM
1470
February 01, 2011 01:23PM
1704
February 01, 2011 08:41PM
2211
February 03, 2011 02:04PM
1668
February 15, 2011 09:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.