Jack-

I think it's pretty much based on preference. I prefer doing everything in 
epoch, it seems to make it easier for me. 
This means that the queries would be selecting for business hours, based 
on epoch time. We do this for our
pix logs, web stats, etc... Calculations are much easier this way since 
there is less converting to do. My dependency
on epoch has led me not to use mysql's built in time/date functions. 

This, of course, is dependent on having epoch in the database in the first 
place. Then I just dynamically
create the 'BETWEEN' queries on the epoch field with the business hours 
between a range, concatenate 
them, and run the query.

As far as efficiency goes, I don't think that this particular query would 
be the dependency. It depends on how
well laid out the dbase is itself, and how the manipulation scripting 
works (what it does). I would assume that 
the manipulation includes streamlining the dataset a bit. 

I have something like this which I use to graph trending (MRTGish) for 
servers (disk/cpu/load/response/etc) across the enterprise (I use nagios 
to gather the data thru snmp). It runs with the same frequency, and I have 
no performance issues generating the
graphs on the fly with any reasonable timeframe. 

Anyhow.. Hope that helps a bit. 

Peter J. Milanese








Jack Coxen <[EMAIL PROTECTED]>
04/06/2004 02:01 PM
 
        To:     "MySQL List (E-mail)" <[EMAIL PROTECTED]>
        cc: 
        Subject:        Query in MySQL vs. PERL


I'm using MySQL to track data throughput information on my company's
routers.  The routers are queried every 5 minutes 24 hours/day.  I need to
produce a report showing data accumulated during business hours - Monday
through Friday, 8:00-5:00.

The program to pull the data and manipulate it will be written in PERL.
What I don't know is, will it be more efficient to have the PERL program
query data from MySQL only for business hours or should I write the MySQL
query (and sub-query) to only SELECT data from business hours.  I can do
either one, I just don't know which one would be best.

I'm running MySQL 4.0.16 standard on a Sun e250 running Solaris 8.  The
database consists of around 650 tables ranging in size from 20 KB to 3-4 
GB
(approx. 12 million records).

Any help and advice would be greatly appreciated.  If more info is needed,
please let me know.

Jack

Jack Coxen
IP Network Engineer
TelCove
712 North Main Street
Coudersport, PA 16915
814-260-2705




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to