- π³πΏNew Zealand quietone
Based on the comment in #15 this should be a won't fix. I am setting to 'needs review' to get opinions.
- π¬π§United Kingdom joachim
This needs an IS update for the title at least, as on D11 it's surely not that function any more!
I found an explanation of 'using filesort' on stack overflow, which says:
> When you don't see "using filesort," it means the order you requested for the query result matches the natural order in which the data was read, so there was no extra work needed to sort the result.
So I'm curious about this. Field values are surely inserted by delta order per-entity ID, so I assume that the reason we're getting a 'using filesort' is because we're loading multiple entities.
What if we did 'order by ID, delta'? That would then probably match the read order.
- πΊπΈUnited States smustgrave
Sounds like there may be more discussion for this. Could someone update the issue summary for how this could be an improvement? Not sure PNMI is the right status but NR didn't spark any conversation. So figured i'd put there before it gets closed out.
- Status changed to Postponed: needs info
9 days ago 3:12pm 9 April 2025 - πΊπΈUnited States smustgrave
Just following up if someone is able to update the summary? else do we close this.
- π·π΄Romania amateescu
I think this can be closed as a duplicate of π SqlContentEntityStorage::loadFromDedicatedTables()() runs a query that does not use indexes if an older revision is being loaded Active .
- π¬π§United Kingdom joachim
This is still the case on D11.
The query is:
SELECT t.* FROM node__body t WHERE (entity_id IN ('1', 2)) AND (deleted = '0') AND (langcode IN ('en', 'und', 'zxx')) ORDER BY delta ASC
and EXPLAINing it still shows a filesort.
I was right in #19 that we could add the entity_id to the sort to get rid of the filesort. But better still, as in the OP, we don't need the sort at all: the values from this query are added to a $values array which already has the entity IDs (or revision IDs) and is already ordered.
So we don't even need to replace the SQL ordering with PHP ordering -- no ordering is needed at all.
- π³π±Netherlands daffie
We can as an alternative solution add a new index on the delta column. Not sure if a multi-column index would be better.