Skip to content

Conversation

mcop1
Copy link
Contributor

@mcop1 mcop1 commented Sep 10, 2025

Changes in this pull request

Resolves #337
Resolves https://github.com/pimcore/service-operations/issues/173
Resolves #343

Additional info

Improvements adapted from #337

  • Added id column with auto_increment as pk
  • Added unique index for elementType and elementId (former pk)
  • IDs will be added to the queue in batches now. Each batch/chunk will have its own transaction, therefore reducing the time a lock is held, if a lock was required
  • Optimized id retrieval from queue using non blocking ids only (FOR UPDATE SKIP LOCKED)

Additional improvements

  • Adding Update/add operations to the queue, for DataObjects, Assets and Documents, are handled async now in most of the cases.
  • Added type filter when selecting related ids for data objects. This will allow better use of data base indexes.
  • Added check for affectedRows: Updating the chunk will happen only if the insert returned affected rows lower than the actual chunk size.
  • Refactored delete statement to include the id column, order by and limit.

Note: Delete operation isnt async for now, since we cant access the deleted element in the backend anymore. To achieve this, more refactoring is needed.

@mcop1 mcop1 added this to the 2.2.0 milestone Sep 10, 2025
@mcop1 mcop1 self-assigned this Sep 10, 2025
@mcop1 mcop1 force-pushed the 337-rethink-index-queue-services-with-workers branch from 139a547 to b0a7d07 Compare September 11, 2025 11:24
@mcop1 mcop1 changed the title [Improvement][WIP]: Improve processing of generic data index queue [Improvement]: Improve processing of generic data index queue Sep 12, 2025
@mcop1 mcop1 marked this pull request as ready for review September 12, 2025 10:57
@herbertroth
Copy link
Member

@mcop1 Please make sure the required reviewer is assigned.

@mcop1 mcop1 requested review from markus-moser and lukmzig and removed request for markus-moser September 15, 2025 13:09
Copy link

@mcop1 mcop1 merged commit ced77fc into 2.x Sep 23, 2025
13 of 14 checks passed
@mcop1 mcop1 deleted the 337-rethink-index-queue-services-with-workers branch September 23, 2025 10:13
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance bottlenecks in getRelatedItemsOnUpdateQuery of assets + data objects Rethink Index Queue Services with Workers
4 participants