#110519Improve Symfony Messenger queue lookup performance
Description
The sys_messenger_messages table currently has separate indexes for queue_name, available_at, and delivered_at. Symfony Messenger’s dequeue query filters and orders using these
columns together with id, so the individual indexes cannot efficiently cover the complete query.
Replace the three indexes with a composite index on:
(queue_name, available_at, delivered_at, id)
Benefits:
- Matches Symfony Doctrine Transport’s queue lookup pattern
- Avoids unnecessary row scans and temporary sorting
- Reduces index storage and write maintenance from three indexes to one
- Improves a synthetic 100,000-row query from approximately 1.479 ms to 0.004 ms (~369× faster)
Reviews 1
History 01
-
Gerrit Code Review pushed patch set 1 for main to change 95384 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-21T21:21:14+00:00" > 08/21/26, 21:21 </span>