Re: Optimizing SQL statement

2006-04-20 Thread Puiu Hrenciuc
First of all thanks all for your answers. Second I'll explain what I manage to do in regard with this issue, maybe someone else may need it in the future. So, first I have started by changing the way I have stored the `ip` field from varchar(15) to int unsigned and populated this field with the 4

Re: Optimizing SQL statement

2006-04-20 Thread Joerg Bruehe
Hi all! (Sorry for the late reply.) Puiu Hrenciuc wrote (re-ordered): "Barry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Puiu Hrenciuc wrote: Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording

Re: Optimizing SQL statement

2006-04-14 Thread Philippe Poelvoorde
2006/4/13, Puiu Hrenciuc <[EMAIL PROTECTED]>: > Hi, > > I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic > data : > > record_time datetime - time when recording was added > ip char(15) - ip that generated the traffic > type tinyint(3) - traffic type ( 1 - local, 2 - inte

Re: Optimizing SQL statement

2006-04-13 Thread Puiu Hrenciuc
Hmmm, I have omited that : I also have an index on (ip,type) in that order "Barry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Puiu Hrenciuc wrote: >> Hi, >> >> I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network >> traffic data : >> >> record_time datetime -

Re: Optimizing SQL statement

2006-04-13 Thread Barry
Puiu Hrenciuc wrote: Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording was added ip char(15) - ip that generated the traffic type tinyint(3) - traffic type ( 1 - local, 2 - internet ) inbound int(10) - in bytes o

Optimizing SQL statement

2006-04-13 Thread Puiu Hrenciuc
Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording was added ip char(15) - ip that generated the traffic type tinyint(3) - traffic type ( 1 - local, 2 - internet ) inbound int(10) - in bytes outbound int(10) - out by