Bug 392633 - Performance regression from 2.1.1 to 2.4: additional select for relationship after find,refresh,lock
Summary: Performance regression from 2.1.1 to 2.4: additional select for relationship ...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2012-10-23 03:33 EDT by Ronny Völker CLA
Modified: 2022-06-09 10:16 EDT (History)
3 users (show)

See Also:


Attachments
test case (24.29 KB, application/octet-stream)
2013-02-07 10:19 EST, Ronny Völker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ronny Völker CLA 2012-10-23 03:33:34 EDT
Given the following scenario:

@Entity 
class A {
  B originalB;
  B currentB;
  ..
}
@Entity
class B {
  ..
}

in the case of A.currentB == A.originalB Eclipseling2.1.1 executes following selects for a find(A.class):
select from a...
select from b...

Eclipselink2.4 executes one more select:
select from a...
select from b...
select from b...

Eclipseling2.1.1 seems to realize, that originalB==currentB and that it only has to query for one B, which can be assigned to both originalB and currentB.

Eclipselink2.4 always seems to execute a distinct query for each relationship.
Comment 1 Tom Ware CLA 2012-11-16 13:24:11 EST
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 James Sutherland CLA 2013-01-17 10:24:33 EST
I cannot reproduce this.  What is the mapping for B?

Please include a test the recreates the issue.
Comment 3 Ronny Völker CLA 2013-02-07 10:19:03 EST
Created attachment 226700 [details]
test case

Added a test case.

It's a bit more complicated.
The first relationship to B is join-fetched. The second is contained in an embeddable C.

run maven clean install
run startstandalone.sh

.hg/patches contains a patch to switch the test case from 2.4 back to 2.1.1.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:09:16 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:16:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink