lmb-embrapa / machado

This repository provides users with a framework to store, search and visualize biological data.
GNU General Public License v3.0
26 stars 15 forks source link

Indexing improvement #318

Closed njbooher closed 3 years ago

njbooher commented 3 years ago

While building the search index, the database was using 100% CPU running this query repeatedly:

SELECT 
(1) AS "a" FROM "feature" INNER JOIN "cvterm" ON ("feature"."type_id" = "cvterm"."cvterm_id") WHERE "cvterm"."name" IN ('SNV', 'QTL') LIMIT 1 

This value shouldn't change while building the search index.

This PR changes it to run only once.

I hereby agree to licence this and any previous contributions under the terms of the GNU General Public License version 3 as published by the Free Software Foundation

I have read the CONTRIBUTING.rst file and understand that TravisCI will be used to confirm the tests and flake8 style checks pass with these changes.

codecov-commenter commented 3 years ago

Codecov Report

Merging #318 (4bb6d52) into master (e9136de) will decrease coverage by 0.05%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #318      +/-   ##
==========================================
- Coverage   69.16%   69.11%   -0.06%     
==========================================
  Files          30       30              
  Lines        4034     4037       +3     
  Branches      229      229              
==========================================
  Hits         2790     2790              
- Misses       1185     1188       +3     
  Partials       59       59              
Impacted Files Coverage Δ
machado/search_indexes.py 0.00% <0.00%> (ø)

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 e9136de...4bb6d52. Read the comment docs.

azneto commented 3 years ago

Thanks!