View Single Post

  #6 (permalink)  
Old 05-12-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Implementing an history with a limited number of entries withMySQL

Salvatore Sanfilippo wrote:
> On May 12, 1:53 am, "nino9st...@yahoo.com" <nino9st...@yahoo.com>
> wrote:
>> If I were doing it, I would write a script on the server that would
>> run at 2am (or whenever) to check the database and remove history.
>> Unless it's a priority to have history removed constantly on the go,
>> this is the best way to ensure it can be done properly and off peak
>> hours. I run several scripts under cronjobs to manipulate the database
>> at night.
>>
>> Nino

>
> Hello Nino, Thanks for the suggestion, I also use to run scripts via
> cron, or even better to have sort of daemons in separated processes
> running DB operations incrementally. Here the problem is a bit harder
> since I've multiple histories (one for customer) and there are no
> "idle"
> periods on the server since we are serving customers in different
> timezones.
>
> Probably the best solution from the point of view of performances is
> to switch from DB to plain files with fixed record length implementing
> a circular buffer, but I could like to take the flexibility of the DB.
>
> Regards,
> Salvatore
>


Why would that be the "best solution". In fact, if your file gets
large, it will probably not perform as well as a database - unless you
add your own indicies and other performance improvements.

And you don't need "idle times" to run these queries. None of them are
going to take hours to execute.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote