Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Micah Gersten
Jim Lucas wrote: > > 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

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
MySQL may have noticed it was impossible with the current data he had using the index on that field, but in the future it may become valid, so I wouldn't necessary eliminate it if it's deemed crucial. A query that returns no results is equally as useful as one that returns many. I'm not arguin

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Ashley Sheridan
On Thu, 2009-02-05 at 08:48 +1100, Chris wrote: > Ashley Sheridan wrote: > > On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: > >> Jônatas Zechim wrote: > >>> For example i’ve this query: > >>> > >>> > >>> > >>> SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' > >>> AND > >

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Ashley Sheridan wrote: On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I ran explain, the result for extra is

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Ashley Sheridan
On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: > Jônatas Zechim wrote: > > For example i’ve this query: > > > > > > > > SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND > > admin_lastping >= '1233762608' AND admin_id='1' > > > > > > > > I ran explain, the result

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I ran explain, the result for extra is ‘Impossible WHERE noticed after reading const table...’ Well this one i

RES: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
Thank i'll try these to see the perfomance.. Thanks Zechim -Mensagem original- De: Jim Lucas [mailto:li...@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] Muti

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jim Lucas
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 NU

RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
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, `admi

Re: [PHP] Mutiple SQL request

2009-02-04 Thread Per Jessen
Jônatas Zechim wrote: > Hi there, i've a system that do a query each 3s, does it impact on > mysql Server? I mean, can this slow my Server? Probably not - if the query and the database doesn't change in between, the results are cached. /Per Jessen, Zürich -- PHP General Mailing List (http://w

Re: [PHP] Mutiple SQL request

2009-02-04 Thread Bastien Koert
lto:phps...@gmail.com] > *Enviada em:* quarta-feira, 4 de fevereiro de 2009 12:46 > *Para:* Jônatas Zechim > *Cc:* php-general@lists.php.net > *Assunto:* Re: [PHP] Mutiple SQL request > > > > > > On Wed, Feb 4, 2009 at 9:43 AM, Jônatas Zechim > wrote: > > Hi ther

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jim Lucas
add a compound index to ctalk_admin ALTER TABLE `ctalk_admin` ADD INDEX (`admin_id`, `admin_lastping`) or something along that line. > > > Thanks, > > Zechim > > > > De: Bastien Koert [mailto:phps...@gmail.com] > Enviada em: quarta-feira, 4 de fever

RES: [PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
can i optimize this query? Is there some tutorial on the net? Thanks, Zechim De: Bastien Koert [mailto:phps...@gmail.com] Enviada em: quarta-feira, 4 de fevereiro de 2009 12:46 Para: Jônatas Zechim Cc: php-general@lists.php.net Assunto: Re: [PHP] Mutiple SQL request On Wed, Fe

Re: [PHP] Mutiple SQL request

2009-02-04 Thread Bastien Koert
On Wed, Feb 4, 2009 at 9:43 AM, Jônatas Zechim wrote: > Hi there, i've a system that do a query each 3s, does it impact on mysql > Server? > I mean, can this slow my Server? > > zechim > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.ph

[PHP] Mutiple SQL request

2009-02-04 Thread Jônatas Zechim
Hi there, i've a system that do a query each 3s, does it impact on mysql Server? I mean, can this slow my Server? zechim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php