List:General Discussion« Previous MessageNext Message »
From:Bruce Ferrell Date:October 2 2011 2:36pm
Subject:Re: 4 minute slow on select count(*) from table - myisam type
View as plain text  
I'd suggest mysqltuner.  You can get it by using:

wget http://mysqltuner.pl

See what suggestions that makes




On 10/02/2011 06:44 AM, Joey L 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
>

Thread
4 minute slow on select count(*) from table - myisam typeJoey L2 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore2 Oct
    • Re: 4 minute slow on select count(*) from table - myisam typeJoey L2 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeBruce Ferrell2 Oct
Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore2 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeJoey L3 Oct
    • Re: 4 minute slow on select count(*) from table - myisam typeJoey L3 Oct
      • Re: 4 minute slow on select count(*) from table - myisam typeBruce Ferrell3 Oct
        • Re: 4 minute slow on select count(*) from table - myisam typeJoey L3 Oct
          • Re: 4 minute slow on select count(*) from table - myisam typeAndrĂ©s Tello3 Oct
            • Re: 4 minute slow on select count(*) from table - myisam typeJoey L3 Oct
              • Re: 4 minute slow on select count(*) from table - myisam typeEric Bergen3 Oct
                • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
                  • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
                    • Re: 4 minute slow on select count(*) from table - myisam typeJohnny Withers6 Oct
                      • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
                        • Re: 4 minute slow on select count(*) from table - myisam typeJohnny Withers6 Oct
                        • Re: 4 minute slow on select count(*) from table - myisam typeJohan De Meersman6 Oct
                        • Re: 4 minute slow on select count(*) from table - myisam typeRik Wasmus6 Oct
                          • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
                            • Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore6 Oct
                              • Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore6 Oct
                                • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
                                  • Re: 4 minute slow on select count(*) from table - myisam typeMichael Dykman6 Oct
Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore6 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeJoey L6 Oct
Re: 4 minute slow on select count(*) from table - myisam typeJohnny Withers6 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeJohan De Meersman7 Oct
Re: 4 minute slow on select count(*) from table - myisam typeJan Steinman7 Oct
  • Re: 4 minute slow on select count(*) from table - myisam typeJoey L7 Oct
    • Re: 4 minute slow on select count(*) from table - myisam typeAndrew Moore7 Oct