Re: Table optimization ideas needed

From: Date: Thu, 27 Mar 2008 02:17:03 +0000
Subject: Re: Table optimization ideas needed
References: 1 2 3 4 5 6 7 8  Groups: php.db 
Request: Send a blank email to php-db+get-44827@lists.php.net to get a copy of this message
On Thu, Mar 27, 2008 at 10:03 AM, Chris <dmagick@gmail.com> wrote: > > mysql> explain select count(*) from message; > > > > > > +----+-------------+---------+-------+---------------+--------+---------+------+----------+-------------+ > > | id | select_type | table | type | possible_keys | key | key_len > > | ref | rows | Extra | > > > > > > +----+-------------+---------+-------+---------------+--------+---------+------+----------+-------------+ > > | 1 | SIMPLE | message | index | NULL | status | 1 > > | NULL | 23051499 | Using index | > > > > > > +----+-------------+---------+-------+---------------+--------+---------+------+----------+-------------+ > > > > Three queries return the same results. > > > > That's never going to be fast because you're using innodb tables. Should I change it to MyISAM ones? > > > From a previous post: > > > Then you can imagine how much time sql such as "select a,b from > > table_name where c='d'" will take. > > > > I have a lot of tables like that. So my questions is: > > What's your practice to optimize tables like that? > > I thought that's what you needed help with. ? > No. That's only part of it. I have a cron job, which get the total visits often. > > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > -- Regards, Shelley

« previous php.db (#44827) next »