Aias00 opened a new issue, #6999:
URL: https://github.com/apache/rocketmq-dashboard/issues/6999

   ## Branch
   `rocketmq-studio` at c34535db0.
   
   ## Evidence
   `AiConversationService.timeline()` calls `runsReferencedBy()`, which 
collects the page run IDs but loads all rows through 
`runRepository.findByConversationId()` before filtering in Java. 
`MybatisPlusAiRunRepository` has no bound or ID predicate for that read. 
Fetching P event pages in a conversation with R turns repeatedly materializes 
approximately P × R run rows even when each page references only a few runs. 
Actual latency has not been benchmarked.
   
   ## Design and implementation
   - Add an owner-conversation-scoped repository lookup for the distinct run 
IDs referenced by this bounded event page.
   - Query by conversation_id and id IN (...) once per page, keeping empty 
collections out of SQL and retaining the current turn/id result ordering.
   - Keep the existing full-history repository method for other consumers. Do 
not add a cache or change the timeline response contract.
   - Test service integration (page IDs, unrelated runs excluded, 
empty/unreadable pages), emitted SQL and real persistence behavior using the 
existing test harness.
   
   ## Validation
   Targeted service/repository/persistence tests and compilation. This is a 
query-volume optimization; no numerical latency improvement is claimed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to