[DDC-1552] JTI Owning table for identifier columns could/should be the entitytable Created: 22/Dec/11  Updated: 22/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Improvement Priority: Major
Reporter: Alexander Assignee: Alexander
Resolution: Unresolved Votes: 0
Labels: None


When ordering a JTI entity on id, the generated SQL will use the table of the root entity. This is because the root entity is listed as owner of the field in the _owningTableMap, leading to non-optimal queries.

More information see:

Comment by Alexander [ 22/Dec/11 ]

I can pick this up if it's agreed upon that this could indeed be improved.

Comment by Marco Pivetta [ 22/Dec/11 ]

The problem here is that joining with a JTI causes LEFT JOINS, which don't perform very well when it comes to sorting the results.

Just as a quick reference, here's where "something" should be changed to get this working:

When the field is part of the primary key, the field used for sorting results should be the one of the table of the entity itself, and not of the root of the CTI.

Generated at Sat Sep 05 12:39:28 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.