Bug #1184 (new)
Opened 15 years ago
Last modified 15 years ago
Slow query ? — at Version 1
Reported by: | atarkowska | Owned by: | jamoore |
---|---|---|---|
Priority: | minor | Cc: | |
Sprint: | n.a. | ||
Total Remaining Time: | n.a. |
Description (last modified by atarkowska)
I add pagination to the webclient but still the query seems to be 'slow'. Select was done on the dataset with 2440 images.
Slow means: start time: 2009-02-14 14:17:51.372902, end time: 2009-02-14 14:18:12.784592, or maybe 21sec is ok ;-)
import omero import time from omero.rtypes import * ds_id = 56 page = 1 c = omero.client("mage", 4063) c.createSession("jason", password) #c.joinSession("08c9796e-6fa7-4d1b-9683-68d64fc6add0") admin_serv = c.sf.getAdminService() query_serv = c.sf.getQueryService() cx = admin_serv.getEventContext() p = omero.sys.Parameters() p.map = {} p.map["eid"] = rlong(cx.userId) p.map["oid"] = rlong(ds_id) if page is not None: f = omero.sys.Filter() f.limit = rint(24) f.offset = rint((int(page)-1)*24) p.theFilter = f sql = "select im from Image im join fetch im.details.owner join fetch im.details.group " \ "left outer join fetch im.datasetLinks dil left outer join fetch dil.parent d " \ "where d.id = :oid and im.details.owner.id=:eid order by im.id asc" print datetime.datetime.now() print len(query_serv.findAllByQuery(sql,p)) print datetime.datetime.now() c.sf.closeOnDestroy()
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.