Is your table MyISAM or InnoDB? A
On Sun, Oct 2, 2011 at 2:44 PM, Joey L <mjh2...@gmail.com> wrote: > I have having issues with mysql db - I am doing a "select count(*) from > table" -- and it take 3 to 4 min. > My table has about 9,000,000 records in it. > I have noticed issues on my web pages so that is why i did this test. > I have about 4 gig of memory on the server. > Is there anything I can do to fix the issue ???? > My my.cnf looks like this : > # * Fine Tuning > # > key_buffer = 256M > max_allowed_packet = 16M > thread_stack = 192K > thread_cache_size = 32 > # This replaces the startup script and checks MyISAM tables if needed > # the first time they are touched > myisam-recover = BACKUP > max_connections = 100 > table_cache = 1024 > thread_concurrency = 20 > # > # * Query Cache Configuration > # > query_cache_limit = 1M > query_cache_size = 512M > # > # * Logging and Replication > # > # Both location gets rotated by the cronjob. > # Be aware that this log type is a performance killer. > # As of 5.1 you can enable the log at runtime! > general_log_file = /var/log/mysql/mysql.log > general_log = 1 > # > # Error logging goes to syslog due to > /etc/mysql/conf.d/mysqld_safe_syslog.cnf. > # > # Here you can see queries with especially long duration > #log_slow_queries = /var/log/mysql/mysql-slow.log > #long_query_time = 2 > #log-queries-not-using-indexes > # > # The following can be used as easy to replay backup logs or for > replication. > # note: if you are setting up a replication slave, see README.Debian about > # other settings you may need to change. > #server-id = 1 > #log_bin = /var/log/mysql/mysql-bin.log > expire_logs_days = 10 > max_binlog_size = 100M > #binlog_do_db = include_database_name > #binlog_ignore_db = include_database_name > # > # * InnoDB > # > # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. > # Read the manual for more InnoDB related options. There are many! > # > # * Security Features > # > # Read the manual, too, if you want chroot! > # chroot = /var/lib/mysql/ > # > # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". > # > # ssl-ca=/etc/mysql/cacert.pem > # ssl-cert=/etc/mysql/server-cert.pem > # ssl-key=/etc/mysql/server-key.pem >