> -----Original Message-----
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 28, 2004 12:51 PM
> To: Christopher Lyon
> Cc: Perl Beginners List
> Subject: Re: Moving Data from one table to another table
> 
> On Tue, 28 Dec 2004, Chris Lyon wrote:
> 
> > So, I am trying to move data from one sql table to another table
> > called logs_archive. It seems that I am running into some problems
> > with memory as I am moving this much data from one table to another.
> > This is just syslog data but we need to archive it in some way. Can
> > anybody give any advice? Code is below.
> 
> You're archiving syslog data?
> 
> Then why pump it into a database to begin with?
> 
> Log data `bzip`s wonderfully well, you know...

We have a couple of scripts that pull over the data in the DB to gather
stats look for certain things and we only need this data for a day or so.
Then it gets moved to other tables for reference for up to a week. Once the
week is over all the data gets moved to a file and the tables get hacked.

> 
> > $sth = $dbh->prepare( "select * from logs where ( timestamp <=
> > '$start_date$start_time' )" );
> 
> If you stub in values for $start_date and $start_time, what happens when
> you run this statement directly to your database?
> 

Runs just fine. When I vmstat while this is running the free memory goes
down and down until there is almost nothing left.

> You don't mention what database server you're running, but in the SQL
> dialects I'm familiar with, '<=' isn't a valid operator I'm aware of.
> 
> In any case, you don't really spell out what the problem is. Does this
> code work, but run too slowly, or does it not work at all? What happens
> when you run this script?
> 

MySQL is what we are running and the operator was something left over from
another script. 

As for what the real problem is: Resources and slowness is the main problem
and every so often the script won't complete.

> 
> 
> --
> Chris Devers



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to