mirror of
https://github.com/doctrine/orm.git
synced 2026-04-29 09:23:20 +02:00
DDC-2842: Leave out discriminator part of Doctrine' generated SQL #3548
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 6, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user roelvd:
Assume the following AbstractPage model:
And the following DQL query:
The generated SQL will be:
Now to the question: how can I remove the WHERE clause from this query. On more complex queries this part of the WHERE clause makes it not possible to use some indexes that are defined. This can be resolved by adding type to the indexes, but this makes my indexes larger and I feel this is not necessary.
The AbstractPage is the root in the inheritance tree. Thus we are interested in ALL records in the table. Omiting the WHERE part does precisely that.
So the question is: how can I make Doctrine remove this WHERE part where it is not necessary.