[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Omaha.pm] DBI::Profile
Whoah... DBI comes with a built-in profiler now. Just set the
DBI_PROFILE environment variable and run your program. It's magic!
Cool! Thanks http://perlcast.com/ !
j
$ export DBI_PROFILE=2
$ pwd
/home/jhannah/Omni/MVC/Control/Rates/t
$ time perl Avail_demo.pl
DBI::Profile: 0.546727s 54.67% (1062 calls) Avail_demo.pl @ 2007-02-26
13:20:13
'' =>
0.086300s / 28 = 0.003082s avg (first 0.078487s, min 0.000002s, max
0.078487s)
'SELECT * FROM surcharges where prop = 'ATLCNN' ' =>
0.003786s / 10 = 0.000379s avg (first 0.001137s, min 0.000072s, max
0.001137s)
'SELECT * FROM gtd_policy_dates WHERE prop = 'ATLCNN' and edate >=
'05/23/2007' and sdate <= '05/23/2007' ' =>
0.009707s / 41 = 0.000237s avg (first 0.000948s, min 0.000137s, max
0.001818s)
'SELECT * FROM master_rate_info where prop = "ATLCNN" and rate_abbrv
IN ("AA1DLX", "AA2DLX", "AR1DLX", "BABDLX", "BARDLX", "BARPRE", "CEDLX",
"CEPRE", "CORDLX", "HD2DLX", "HDPDLX", "HOHDLX", "LESDLX", "PK1DLX",
"PK4DLX", "PK6DLX", "PK7DLX", "PK8DLX", "PK9DLX", "PKBDLX", "R42CDX",
"R42RDX", "R4CHDX", "REVDLX", "TEST1") ' =>
0.011639s / 28 = 0.000416s avg (first 0.002047s, min 0.000003s, max
0.002047s)
'SELECT * FROM rates where rate_code = ? and (eff_start_date <= ? and
eff_stop_date >= ?) ' =>
...etc...
Yes, we're hitting the database 1,062 times. :) :( ?