Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Upon attempting to delete a user and all associated content, relation_query_enforce_distinct_endpoints_alter generates an SQL query that will run for a very very long time (i.e. I manually killed it after running for 30 hours).
Details:
I have a site with six relations, one of which hooks into the user account. When account cancel is attempted, it generates the query in the attachment and subsequently locks the user table from further changes until the SQL process is manually killed.
Comment | File | Size | Author |
---|---|---|---|
crazy-big.sql_.txt | 55.11 KB | zxaos |
Comments
Comment #1
mikran CreditAttribution: mikran commentedYes this is unsolved issue, #1570510: relation_entity_delete() is unneccesarily destructive..
Comment #2
mikran CreditAttribution: mikran commentedActually I think this is different issue and why an earth would anyone need to check for uniqueness of relations that have that many endpoints (20+).
I think the solution for this is to limit relation exists calls to just 2 endpoints, so the question is "Are these two entities related?". And relation type uniqueness should then be limited to binary relations only. Altough that's an API change that will probably break a lot of things.
Comment #3
mikran CreditAttribution: mikran commentedBut I believe your situation should be fixed if you remove the unique setting from the relation type. Then these crazy queries will not be generated.