... see Query Statistics

Top 10 Queries by Average execution time

bean orig hash exe count avg beans avg micros autofetch tuned last query
detail app.data.Bug 993345720 33237 12 1839 true 05-Feb 09:36:20
detail app.data.Bug -604475720 37426 0 1785 true 05-Feb 11:36:11
detail app.data.Bug -1305179324 1991 9 1749 true 05-Feb 10:30:31
detail app.data.Topic 722532051 61558 0 1127 true 05-Feb 11:06:25
detail app.data.Topic 592257536 35513 23 906 true 05-Feb 11:36:32
detail app.data.Forum 887892902 1795 5 596 true 05-Feb 10:24:03
detail app.data.Forum 1908865224 35513 0 555 true 05-Feb 11:36:32
detail app.data.BugAttachment -604475720 37436 0 386 false 05-Feb 11:36:11
detail app.data.Forum 722532051 61567 0 278 false 05-Feb 11:06:25
detail app.data.Topic -149309933 8975 5 220 true 05-Feb 10:24:03

Top 10 Queries by Total aggregate execution time

bean orig hash exe count avg beans avg micros autofetch tuned last query
detail app.data.Topic 722532051 61558 0 1127 true 05-Feb 11:06:25
detail app.data.Bug -604475720 37426 0 1785 true 05-Feb 11:36:11
detail app.data.Bug 993345720 33237 12 1839 true 05-Feb 09:36:20
detail app.data.Topic 592257536 35513 23 906 true 05-Feb 11:36:32
detail app.data.Forum 1908865224 35513 0 555 true 05-Feb 11:36:32
detail app.data.Forum 722532051 61567 0 278 false 05-Feb 11:06:25
detail app.data.BugAttachment -604475720 37436 0 386 false 05-Feb 11:36:11
detail app.data.Bug -1305179324 1991 9 1749 true 05-Feb 10:30:31
detail app.data.Topic -149309933 8975 5 220 true 05-Feb 10:24:03
detail app.data.Forum 887892902 1795 5 596 true 05-Feb 10:24:03

 

// code to get Top 10 queries by average execution time 

List<MetaQueryStatistic> list = Ebean.find(MetaQueryStatistic.class).findList();
  	
long nowMinus24Hrs = System.currentTimeMillis() -24*(1000*60*60);

list = Ebean.filter(MetaQueryStatistic.class)
		.sort("avgTimeMicros desc")
		.gt("executionCount", 0)
		.gt("lastQueryTime", nowMinus24Hrs)
		.maxRows(10)
		.filter(list);

Strictly speaking we are looking at Ebean "Query Plans". The query plan can be reused with different 'bind' values.

HeadingDescription
orig hashThe original (pre autofetch tuning) query plan hash
exe countNumber of Queries executed
avg beansAverage number of beans loaded per query
avg microsAverage number of microseconds each query execution takes
autofetch tunedTrue when the query is tuned by Autofetch
collection startTime and date when the statistics started being collected
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse