Issue Details (XML | Word | Printable)

Key: HHH-2948
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Diego Plentz
Reporter: pi zhigang
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Hibernate Core

QueryStatistics.executionMinTime always = 0

Created: 13/Nov/07 01:55 AM   Updated: 19/Dec/07 09:07 PM   Resolved: 19/Dec/07 09:07 PM
Component/s: core
Affects Version/s: 3.2.0.ga
Fix Version/s: 3.2.6, 3.3.0.CR1

Time Tracking:
Not Specified

Environment: database Oracle10g

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Diego Plentz, Michael Plöd and pi zhigang


 Description  « Hide

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;



pi zhigang added a comment - 13/Nov/07 02: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.


Michael Plöd added a comment - 14/Dec/07 07:09 AM

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