Nov 212012
 

1. Editer le fichier my.ini

2. Augmenter la taille du buffer mémoire (attention à ne pas dépasser 80% de la mémoire disponible)

# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system.  Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
#innodb_buffer_pool_size=47M
innodb_buffer_pool_size=512M

Résultat pour la même requète :

Avant

12:43:19 SELECT co.Name,  (SELECT MAX(ci.Population)   FROM city_huge ci  WHERE ci.CountryCode = co.Code) FROM country_huge co 
239 row(s) returned 354.297 sec / 0.000 sec

Aprés

12:52:00 SELECT co.Name,  (SELECT MAX(ci.Population)   FROM city_huge ci  WHERE ci.CountryCode = co.Code) FROM country_huge co 
239 row(s) returned 4.516 sec / 0.000 sec
VN:F [1.9.22_1171]
Cette astuce est pratique ? laissez un vote ;)
Rating: 10.0/10 (1 vote cast)
Nov 212012
 

1. Télécharger et installer ActivePerl : http://www.activestate.com/activeperl/downloads/

2. Editer le fichier de conf « my.ini »

slow_query_log=1
slow_query_log_file=c:\logmysql.log
long_query_time=0.1

3. Redémarrer mysql

4. Exécuter sous DOS

C:\Documents and Settings\Formation>perl "C:\Program Files\MySQL\MySQL Server 5.
5\bin\mysqldumpslow.pl" c:\logmysql.log
Reading mysql slow query log from c:\logmysql.log
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), 0users@0hosts
c:\Program Files\MySQL\MySQL Server N.N\bin\mysqld, Version: N.N.N-log (MySQL
Community Server (GPL)). started with:
TCP Port: N, Named Pipe: (null)
# Time: N N:N:N
# User@Host: root[root] @ localhost [N.N.N.N]
# Query_time: N.N Lock_time: N.N Rows_sent: N Rows_examined: N
SET timestamp=N;
SHOW FULL COLUMNS FROM `world_innodb`.`city`
VN:F [1.9.22_1171]
Cette astuce est pratique ? laissez un vote ;)
Rating: 0.0/10 (0 votes cast)