- Issue created by @prudloff
- @prudloff opened merge request.
- Status changed to Needs review
about 2 years ago 5:18pm 27 March 2023 - Status changed to Needs work
about 2 years ago 12:41am 28 March 2023 - πΊπΈUnited States smustgrave
Sounds like a valid use case.
Can we add a kernel test maybe to make sure they come out alphabetically.
- π΅π±Poland artemboiko
Caught the same problem, thanx for saving time.)
- First commit to issue fork.
- Merge request !8633Issue #3350704: Order strings from the database alphabetically by source and then context β (Open) created by tgauges
- π©πͺGermany tgauges
I created a new branch against 11.x which first sorts the translations by their source string and then the context. The context is needed for equal source string with different context.
Before review, the test should be extended to also test the case for equal source strings but different context.
- π«π·France prudloff Lille
prudloff β changed the visibility of the branch 3350704-order-translations-alphabetically to hidden.
- πΊπΈUnited States smustgrave
Removing the tests tag as https://git.drupalcode.org/issue/drupal-3350704/-/jobs/4589844 shows the coverage
See no issue with ordering these.
- π¬π§United Kingdom catch
I think this might need a new database index - see note on the MR.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
We need to add an index then to avoid the `using filesort` - thanks @tgauges
- π©πͺGermany tgauges
What kind of index needs to be added to "avoid the
using filesort
"?I read a bit of MySQL ORDER BY Optimization but my experiments did not result in the avoidance of
using filesort
when runningEXPLAIN SELECT s.* FROM locales_source s ORDER BY s.source ASC, s.context ASC;
.I tried the following on 10.11.11-MariaDB-ubu2204-log:
- Change the existing index
(source(30), context)
to(source(2048), context)
. - Add a new index
(source(2048))
. - Add a new index
(context)
.
The largest context value in my database is 1452 queried with
SELECT length(source) AS length FROM locales_source ORDER BY length DESC;
. - Change the existing index
- πΊπΈUnited States smustgrave
Hello @tgauges first appreciate taking on this task!
Since this seems to be still in discussion moving to NW, discussions can still happen without being in review