Skip to content

cache the results of lookups for qt_query_status_type and qt_query_re…#26

Open
XcrigX wants to merge 1 commit intoi2b2:masterfrom
XcrigX:perf-cache-QT-lookups
Open

cache the results of lookups for qt_query_status_type and qt_query_re…#26
XcrigX wants to merge 1 commit intoi2b2:masterfrom
XcrigX:perf-cache-QT-lookups

Conversation

@XcrigX
Copy link

@XcrigX XcrigX commented Jul 9, 2025

This PR just caches the results of lookups for qt_query_status_type and qt_query_result_type to avoid repeated calls. These get called repeatedly to lookup the status code values, and as far as I can tell the data should be static. In a simple test it reduced the number of SQL statements executed against the the QT_xxx tables on startup from ~150 down to ~60 (depending on the query history). This load reduction will occur whenever the Queries frame is refreshed as well.

NOTE: this could be done even better by running a "select * " once initially and caching all the values, but it was a more light-weight change to just cache the individual calls for the same values so at least it doesn't need to lookup a given code more than once.

…sult_type to avoid repeated calls

Signed-off-by: craig mcclendon <cgithub@loudog.org>
@XcrigX XcrigX force-pushed the perf-cache-QT-lookups branch from e920f7c to dbffe8f Compare July 9, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant