Delete records using \Drupal\entity_usage\EntityUsageInterface::bulkDeleteSources() is slow

Created on 28 January 2025, 25 days ago

Problem/Motivation

When we regenerate entity usage stats we do a delete at the beginning of each entity type we're processing. This has two problems:

  • It is slow
  • If the configuration has changed to remove an entity type it is not removed.

Steps to reproduce

Proposed resolution

Add a new truncateTable method to \Drupal\entity_usage\EntityUsageBulkInterface and and a batch step to call it.

Remaining tasks

User interface changes

None

API changes

New \Drupal\entity_usage\EntityUsageBulkInterface::truncateTable() method

Data model changes

None

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024