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

Analysis optimisation #1211

Open
davmlaw opened this issue Dec 11, 2024 · 0 comments
Open

Analysis optimisation #1211

davmlaw opened this issue Dec 11, 2024 · 0 comments

Comments

@davmlaw
Copy link
Contributor

davmlaw commented Dec 11, 2024

Go and collect say, examples of the slowest queries on vg.com

Then recreate them, and see if we can improve them.

It's possible that we could do some things to optimise queries, eg to make an index for low / NULL gnomAD:

CREATE INDEX idx_gnomad_af_null_or_low ON annotation_variantannotation_version_10 (gnomad_af) WHERE (gnomad_af <= 0.01 OR gnomad_af IS NULL);

Apparently you can do this in Django via:

from django.db import models
from django.contrib.postgres.indexes import Index

class MyModel(models.Model):
    gnomad_af = models.FloatField(null=True)

    class Meta:
        indexes = [
            Index(
                fields=['gnomad_af'],
                name='gnomad_af_null_or_low_idx',
                condition=models.Q(gnomad_af__lte=0.05) | models.Q(gnomad_af__isnull=True),
            ),
        ]

The other thing to look into is the sample regex query. It might be better to substring out and do string matches

@davmlaw davmlaw added this to the VG4 non-critical milestone Dec 11, 2024
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

No branches or pull requests

1 participant