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.
The path whitelist rebuilding code has a very interesting little query:
SELECT SUBSTRING_INDEX(source, '/', 1) AS path FROM {url_alias} GROUP BY path
This is SQL-92 compliant (SQL-92 only allow GROUP BY from column names or aliases and ordinal positions), but it is not supported neither by Oracle nor by SQL Server.
I suggest we rewrite it as a DISTINCT query, which is what we actually mean here anyway.
Comment | File | Size | Author |
---|---|---|---|
#1 | 03-770664-path-group-by-alias.patch | 878 bytes | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedSomething like this will do.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedIs there any performance impact here?
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedThe meaning is unchanged.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
catchI just spotted this after seeing the query was different between Pressflow and D7/8.
Better late than never with the performance comparison:
This is on a Drupal 6/Pressflow site with millions of path alias.
SELECT SUBSTRING_INDEX(path, '/', 1) AS path FROM menu_router GROUP BY path;
Both queries come in at 4.91 seconds for me.