RES: RES: [PHP] Mutiple SQL request
| From: | Jônatas Zechim | Date: | Wed, 04 Feb 2009 18:14:09 +0000 |
| Subject: | RES: RES: [PHP] Mutiple SQL request | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287623@lists.php.net to get a copy of this message | ||
Thank i'll try these to see the perfomance..
Thanks
Zechim
-----Mensagem original-----
De: Jim Lucas [mailto:lists@cmsws.com]
Enviada em: quarta-feira, 4 de fevereiro de 2009 16:11
Para: Jônatas Zechim
Cc: 'Bastien Koert'; php-general@lists.php.net
Assunto: Re: RES: [PHP] Mutiple SQL request
Jônatas Zechim wrote:
> Can you dump the table structure to show us how you've set it up?
>
> Bastien
>
> Cat, the other other white meat
>
>
>
> Yeah, that’s it:
>
>
>
> CREATE TABLE
ctalk_admin (
>
> admin_id int(9) NOT NULL auto_increment,
>
> admin_nome varchar(50) NOT NULL,
>
> admin_login_nome varchar(32) NOT NULL,
>
> admin_pass varchar(32) NOT NULL,
>
> admin_login int(10) NOT NULL,
>
> admin_lastping int(10) NOT NULL,
>
> PRIMARY KEY (admin_id),
>
> KEY admin_lastping
> (admin_lastping)
>
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
>
>
I would add a second column to that admin_lastping KEY
KEY admin_lastping (admin_lastping, admin_id)
Since you are using both columns in your where clause, they both need to be specified /in the same/
index for and index to be used.
Otherwise, some random index might be used. But you will get the best performance if both are
listed in the same index.
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare