Improve performance for path_alias queries in a workspace

Created on 2 October 2024, 4 months ago

Problem/Motivation

The SQL query generated by \Drupal\path_alias\AliasRepository::lookupBySystemPath() is very slow in a workspace context.

Steps to reproduce

Check the execution time for the query generated by AliasRepository::lookupBySystemPath() in Live vs. a workspace.

Proposed resolution

There are two things we can do to improve this:

  1. Add the same indexes that we have on the path_alias table to the path_alias_revision table
  2. Improve \Drupal\workspaces\WorkspacesAliasRepository::getBaseQuery() by adding a langcode condition on the join between the base and revision table

Remaining tasks

- write an upgrade path test
- review

User interface changes

Nope.

Introduced terminology

Nope.

API changes

Nope.

Data model changes

The path_alias_revision tables has two new indexes.

Release notes snippet

Nope.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

workspaces.module

Created by

πŸ‡·πŸ‡΄Romania amateescu

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024