Summary: | Unnecessary Table Join in Native Many-to-Many Query generated from JPQL | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | z_Archived | Reporter: | Bernard Missing name <bht237> | ||||||
Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> | ||||||
Status: | REOPENED --- | QA Contact: | |||||||
Severity: | enhancement | ||||||||
Priority: | P3 | CC: | jamesssss, tom.ware | ||||||
Version: | unspecified | Keywords: | performance | ||||||
Target Milestone: | --- | ||||||||
Hardware: | PC | ||||||||
OS: | Windows Vista | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Bernard Missing name
2010-02-02 16:05:36 EST
Created attachment 157965 [details]
NetBeans project in zip file
What does the actual SQL look like? I assume it includes a join between the project table and the employee_project table? Are you asking us to optimize that out? Tom, Yes, I am suggesting to remove the Poject table. It appears to be quite common that EclipseLink unnecessarily joins a table only to use its primary key in other joins. Changing to enhancement. Fixing in trunk / 2.2 I asume the JPQL query was something like: "Select e from Employee e join e.projects p where p.id = :id" Please confirm? Created attachment 177337 [details]
patch to optimize out join
Fixed in EclipseLink 2.2 Hmm, this caused a test failure, and looking deeper into the issue, this is more difficult than I thought. Reverting fix, and reopenning bug. Issue is that the join to the join table is still required and must be normalized once, so querying on project.id and project.name would get very difficult to normalize. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |