-
Notifications
You must be signed in to change notification settings - Fork 1
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
the core ontology tree browser is slow #77
Comments
I've been inspecting the code and here are my observations so far of what could be slowing us down:
|
Ok after testing each function individually, it looks like |
A few trials changing how the query is structured: OriginalThis is run once for every accession. In this case, multiply by 3 since those are the root GO terms. Effectively we are looking at SELECT COUNT(TCEL.entity_id)
from tripal_cvterm_entity_linker TCEL
inner join chado_bio_data_7 CB on CB.entity_id = TCEL.entity_id
inner join chado.feature CF on CF.feature_id = CB.record_id
where CF.organism_id = 46 and TCEL.database = 'GO' and accession = '0003674';
count
-------
15156
(1 row)
Time: 3126.406 ms The fastestThis is run once for all given accessions so the time shown below is final. SELECT TCEL.database, TCEL.accession, COUNT(TCEL.entity_id)
from tripal_cvterm_entity_linker TCEL
inner join chado_bio_data_7 CB on CB.entity_id = TCEL.entity_id
inner join chado.feature CF on CF.feature_id = CB.record_id
where CF.organism_id = 46 and TCEL.database = 'GO'
and accession in ('0008150', '0003674', '0005575') group by TCEL.database, TCEL.accession;
database | accession | count
----------+-----------+-------
GO | 0003674 | 15156
GO | 0008150 | 13532
GO | 0005575 | 4337
(3 rows)
Time: 2969.810 ms This means we manage to be 3 times faster if we switch ti eager loading. The DrawbackIn-memory operations are increased heavily using this approach and therefore we need to be careful about how many accessions we process at any given time. That said, we are already in the safe side since we never process over 25 accessions at a time. |
I am going to implement this change and see how that affects our dev site. |
Dev StatsStats are obtained for Fraxinus excelsior Pre-eager loading16.46s Post-eager loading12.97 s Well that's disappointing 😞 Not nearly enough speedup but some progress |
Ok I think the answer lies in an mview that acts as a cache of counts for each entity: The mview should look something like this
If we do implement this MView we need to populate it after the end of every indexing job which should be easy enough to do programatically. |
this is really a core issue, we'll get thhere eventually.
I was reviewing a PR used that used the old tripal 2 tripal_cv ontology browser: tripal/tripal_analysis_go#12
It was fast. really fast.
Our module is slow, but its slow because the new tripal 3 core tree browser is slow.
Is there any way we can speed it up?
The text was updated successfully, but these errors were encountered: