QueryStatistics.executionMinTime always = 0

Description

Becuase executionMinTime is initialized as zero (long default):
— org.hibernate.stat.QueryStatistics.java ---- private long executionMinTime;

and, the logic for assignment statement is:
void executed(long rows, long time) {
if (time < executionMinTime) executionMinTime = time;
...

I think the initial value for executionMinTime should be:
private long executionMinTime = Long.MAX_VALUE;

Environment

database Oracle10g

Activity

Show:
pi zhigang
November 13, 2007, 10:04 AM

Currently, the avg, min, max values for first run of every query are:
avg=123, min=0, max=123

at this time, you known, the min value can't be large than 0 for ever.

mploedN
December 14, 2007, 3:09 PM

I like the proposed solution. Another option would be to use a private boolean flag value which tells if the minTime has been set.

Steve Ebersole
March 21, 2011, 7:05 PM

Bulk closing stale resolved issues

Assignee

Diego Plentz

Reporter

pi zhigang

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure