fleet/changes/32296-optimize-list-script-results
Victor Lyuboslavsky 73b629ee1b
Optimized GetHostScriptExecutionResults MySQL query for for large numbers of script results. (#32595)
Fixes #32295 

The issue was identified/fixed using this performance test:
https://gist.github.com/getvictor/b289b7b14981fb7bf77e57c80af117d1

With the fix:
  - 100 records: 2.6ms (similar)
  - 1,000 records: ~7ms (32x faster)
  - 5,000 records: ~10ms (530x faster)
  - 10,000 records: 13ms (1,430x faster)
  - 20,000 records: ~25ms (2,960x faster)
  - 40,000 records: 50ms (6,000x faster)


# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- Script details now surface the most relevant “latest” status per
script, prioritizing upcoming executions when present.
- Performance Improvements
- Significantly faster loading of host script results and script
details, especially at large scale.
  - Improved responsiveness when filtering/sorting script results.
- Documentation
- Added changelog entry describing the optimization to script results
handling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-04 15:48:18 -05:00

1 line
105 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

* Optimized the query used to list a hosts script results so it performs well with large result sets.