Skip to content

Commit

Permalink
Tweak fill query to filter on pubid instad of id
Browse files Browse the repository at this point in the history
This small change has a very big impact on the performance of the query
  • Loading branch information
marcospri committed Oct 30, 2023
1 parent ac30cc0 commit f64109a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h/tasks/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def fill_annotation_slim(batch_size=1000):
annotations = (
celery.request.db.query(Annotation)
.outerjoin(AnnotationSlim)
.where(AnnotationSlim.id.is_(None))
.where(AnnotationSlim.pubid.is_(None))
.order_by(Annotation.updated.desc())
.limit(batch_size)
)
Expand Down

0 comments on commit f64109a

Please sign in to comment.