On Wed, Nov 24, 1999 at 07:48:24AM -0800, Randal L. Schwartz wrote:
> 
>     my @FIELDS =
>       qw(when host method url user referer browser status bytes
>          wall cpuuser cpusys cpucuser cpucsys);
>     my $INSERT =
>       "INSERT INTO $DB_TABLE (".
>       (join ",", @FIELDS).
>       ") VALUES(".
>       (join ",", ("?") x @FIELDS).
>       ")";

>            eval {
>              my $dbh = DBI->connect($DSN, (split ':', $DB_AUTH),
>                                    { RaiseError => 1 });
>              my $sth = $dbh->prepare($INSERT);
>              $sth->execute(@data);
>              $sth->finish;
>              $dbh->disconnect;
>            };
>            if ($@) {
>              $r->log->error("dbi: $@");
>            }

Changing the prepare to prepare_cached would save you some cpu time.
Also, the finish call is redundant here.

Tim.

Reply via email to