Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1552

JTI Owning table for identifier columns could/should be the entitytable

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      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:
      https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw

        Activity

        Alexander created issue -
        Hide
        Alexander added a comment -

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

        Show
        Alexander added a comment - I can pick this up if it's agreed upon that this could indeed be improved.
        Alexander made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Alexander [ asm89 ]
        Hide
        Marco Pivetta added a comment - - edited

        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:
        https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316

        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.

        Show
        Marco Pivetta added a comment - - edited 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: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316 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.
        Benjamin Eberlei made changes -
        Workflow jira [ 13289 ] jira-feedback [ 14002 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14002 ] jira-feedback2 [ 15866 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15866 ] jira-feedback3 [ 18122 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1552, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Alexander
            Reporter:
            Alexander
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: