mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Paginate method performs poorly when used with inadequate WHERE conditions #7002
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 @kazamaku on GitHub (Jul 14, 2022).
I used version V2.7.5
I've found the Paginate method performs poorly when used with inadequate WHERE conditions
I'm using MYSQL with a lot of data,The Paginate method automatically uses DISTINCT
After the test, the query time using DISTINCT was 80 seconds, and it only took 0.02 seconds without using DISTINCT
JOIN does create multiple pieces of data,so I try delete leftjoin common_order_product, but DISTINCT will still be used
I found it in the source code, This indicates that DISTINCT is used regardless of whether a JOIN is used ⬇️
So,I modified the source code ⬇️
But I don't know if this revision will affect other scenarios
@kazamaku commented on GitHub (Aug 3, 2022):
After the modification is complete, you find that the sorting is invalid
So I'm going to change it again
I go under certain conditions except for the outermost query
It's been online for 20 days now , It's normal at least now.