> Message du 14/10/08 13:10
> De : "Deviloper"
> A : beginners@perl.org
> Copie à :
> Objet : Optimizing DBI script design?
>
> I am doing a script which updates data sets of thousands of customers on a 
> regular base.
> (Volume data managemed.) This should be near realtime, so the customers know, 
> how much data they transmitted and how much they have to pay.
>
> Because of the type of traffic measurement the input comes in blocks of 1-100 
> datasets which has to be updated.
>
> I found some ideas how to optimize the DB-Updates. 
> (http://www.cwinters.com/programming/dc_pm_dbi.html).
>
> Because my DB-Transactions are very simple updates / inserts I am thinking 
> about the best way to optimize the process.
>
> My thoughts:
>
> Cache all input for a given time and put them in a single statement, which I 
> can execute with one $dbh->do()?
>
> or
>
> Build the standard statement, utilizing placeholders for example:
>
> my $sql = qq/INSERT INTO Products   ( ProductCode, ProductName, Price )   
> VALUES   ( ?, ?, ? )/;
>
>
> $sth $dbh->prepare($sql);
>


Sure, use the "prepare" method, don't use "do" each time.

Jeff.

 Créez votre adresse électronique [EMAIL PROTECTED] 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

Reply via email to