Bonjour,

j'ai pas mal de slow queries provenant d'une table qui ne devrait pas avoir de slow queries:

mysql> select count(*) from FollowUp;
+----------+
| count(*) |
+----------+
| 33 |
+----------+
1 row in set (0.00 sec)

mysql> desc FollowUp;
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| id | varchar(36) | NO | PRI | NULL | |
| clientName | varchar(255) | YES | | NULL | |
| creationTime | datetime | NO | MUL | NULL | |
| message | longtext | YES | | NULL | |
| clientId | varchar(255) | YES | | NULL | |
| userId | varchar(255) | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

# Query_time: 8.930638 Lock_time: 0.000023 Rows_sent: 0 Rows_examined: 52
SET timestamp=1307435828;
delete from FollowUp where creationTime<'2011-06-07 10:36:30';

# Query_time: 8.399880 Lock_time: 0.000038 Rows_sent: 0 Rows_examined: 0
SET timestamp=1307435828;
insert into FollowUp (clientName, creationTime, message, recipientId, userId, id) values ('TOTO', '2011-06-07 10:37:00', 'titi', '22222,', '11111', 'xxx-xx-xx-xx-xxx');

# Query_time: 2.029138 Lock_time: 0.000023 Rows_sent: 0 Rows_examined: 50
SET timestamp=1307435912;
delete from FollowUp where creationTime<'2011-06-07 10:38:00';

mysqltuner:
>> MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.52-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 8G (Tables: 53)
[--] Data in InnoDB tables: 119M (Tables: 32)
[!!] Total fragmented tables: 34

-------- Security Recommendations -------------------------------------------
[!!] User '@localhost' has no password set.

-------- Performance Metrics -------------------------------------------------
[--] Up for: 48d 0h 41m 25s (673M q [162.351 qps], 784K conn, TX: 271B, RX: 142B)
[--] Reads / Writes: 59% / 41%
[--] Total buffers: 1.1G global + 8.2M per thread (400 max threads)
[OK] Maximum possible memory usage: 4.4G (37% of installed RAM)
[OK] Slow queries: 0% (75K/673M)
[OK] Highest usage of available connections: 53% (212/400)
[OK] Key buffer size / total MyISAM indexes: 1000.0M/1.8G
[OK] Key buffer hit rate: 99.4% (569M cached / 3M reads)
[OK] Query cache efficiency: 27.6% (51M cached / 186M selects)
[!!] Query cache prunes per day: 234698
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 2M sorts)
[!!] Temporary tables created on disk: 27% (889K on disk / 3M total)
[OK] Thread cache hit rate: 99% (4K created / 784K connections)
[!!] Table cache hit rate: 1% (282 open / 14K opened)
[OK] Open file limit used: 17% (183/1K)
[OK] Table locks acquired immediately: 99% (335M immediate / 335M locks)
[OK] InnoDB data size / buffer pool: 119.2M/128.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 10M)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
table_cache (> 300)


tuning-primer:

-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -

MySQL Version 5.1.52-log x86_64

Uptime = 48 days 0 hrs 42 min 1 sec
Avg. qps = 162
Total Questions = 673707021
Threads Connected = 31

Server has been running for over 48hrs.
It should be safe to follow these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.1/...variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1.000000 sec.
You have 75297 out of 673707057 that take longer than 1.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is enabled
Binlog sync is not enabled, you could loose binlog records during a server crash

WORKER THREADS
Current thread_cache_size = 10
Current threads_cached = 2
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 400
Current threads_connected = 31
Historic max_used_connections = 212
The number of used connections is 53% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 26 M
Current InnoDB data space = 119 M
Current InnoDB buffer pool free = 0 %
Current innodb_buffer_pool_size = 128 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 2.82 G
Configured Max Per-thread Buffers : 3.23 G
Configured Max Global Buffers : 1.11 G
Configured Max Memory Limit : 4.34 G
Physical Memory : 11.73 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 1.75 G
Current key_buffer_size = 1000 M
Key cache miss rate is 1 : 163
Key buffer free ratio = 14 %
You could increase key_buffer_size
It is safe to raise this up to 1/4 of total system memory;
assuming this is a dedicated database server.

QUERY CACHE
Query cache is enabled
Current query_cache_size = 10 M
Current query_cache_used = 5 M
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = 57.40 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 2 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 2.00 M
You have had 2368 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 1024 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_open_cache = 300 tables
Current table_definition_cache = 256 tables
You have a total of 108 tables
You have 282 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 2404870 temp tables, 27% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 2 M
Current table scan ratio = 9 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 13748
Your table locking seems to be fine

Avez vous des pistes pour optimiser le serveur?

Merci