Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize search: prefetch job columns #3969

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Jun 18, 2021

Currently for every job-module result a SELECT FROM job is executed,
when calling $job_module->job->name.

The prefetch will save the job data in the object and so the extra
SELECT is avoided.
Additionally this commit reduces the selected columns to what is actually
needed.

A search for 'vlc' /api/v1/experimental/search?q=vlc was reduced from 39s to 7s locally.

Currently for every job-module result a `SELECT FROM job` is executed,
when calling $job_module->job->name.

The prefetch will save the job data in the object and so the extra
SELECT is avoided.
Additionally this commit reduces the selected columns to what is actually
needed.

A search for 'vlc' was reduced from 39s to 7s locally.
@codecov
Copy link

codecov bot commented Jun 21, 2021

Codecov Report

Merging #3969 (64d6e00) into master (d4b5411) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3969      +/-   ##
==========================================
- Coverage   96.87%   96.86%   -0.01%     
==========================================
  Files         370      370              
  Lines       32966    32966              
==========================================
- Hits        31937    31934       -3     
- Misses       1029     1032       +3     
Impacted Files Coverage Δ
lib/OpenQA/WebAPI/Controller/API/V1/Search.pm 97.46% <ø> (ø)
lib/OpenQA/Worker/WebUIConnection.pm 89.95% <0.00%> (-0.96%) ⬇️
lib/OpenQA/Worker/Job.pm 77.25% <0.00%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4b5411...64d6e00. Read the comment docs.

@mergify mergify bot merged commit 2ce59c6 into os-autoinst:master Jun 21, 2021
@perlpunk perlpunk deleted the optimize-search branch June 21, 2021 13:37
This pull request was closed.
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.

5 participants