Task #1057 (new)
Opened 11 years ago
Last modified 9 years ago
SELECT N+1 issue with annotations and counts
| Reported by: | jamoore | Owned by: | jamoore |
|---|---|---|---|
| Priority: | major | Milestone: | Unscheduled |
| Component: | Performance | Version: | 3.0-M1 |
| Keywords: | hibernate, queries | Cc: | cxallan, jburel |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | n.a. |
| Sprint: | n.a. |
Description
Like with annotations (#1047), queries over over experimenters join the count values one entity at a time, resulting in N+1 hits to the database, with N of the form:
select
annotation0_.experimenter_id as experime1_0_,
annotation0_.count as count0_,
annotation0_.owner_id as owner3_0_
from
count_Experimenter_annotationLinks_by_owner annotation0_
where
annotation0_.experimenter_id=?
Change History (4)
comment:1 Changed 10 years ago by jmoore
- Milestone changed from OMERO-Beta4 to OMERO-Beta4.1
comment:2 Changed 10 years ago by jmoore
- Milestone changed from OMERO-Beta4.1 to OMERO-Beta4.2
comment:3 Changed 10 years ago by jmoore
- Milestone changed from OMERO-Beta4.2 to Unscheduled
comment:4 Changed 9 years ago by jmoore
Jean-Marie, would the use of IQuery.projection() help here?
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
Unclear on which methods we are running into this. Profiling will most likely be needed (including counting SQL statements). Pushing.