Skip to content

Commit

Permalink
disable sequential scanning for carton program query to speed irt up
Browse files Browse the repository at this point in the history
  • Loading branch information
imedan committed Jan 30, 2024
1 parent 4ce19bc commit 37ac3d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/valis/routes/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from valis.db.queries import (cone_search, append_pipes, carton_program_search,
carton_program_list, carton_program_map,
get_targets_by_sdss_id, get_targets_by_catalog_id)
from sdssdb.peewee.sdss5db import database


class SearchCoordUnits(str, Enum):
Expand Down Expand Up @@ -144,6 +145,7 @@ async def carton_program(self,
description='Specify search on carton or program',
example='carton')] = 'carton'):
""" Perform a search on carton or program """

return list(carton_program_search(name, name_type))
with database.atomic() as transaction:
database.execute_sql('SET LOCAL enable_seqscan=false;')
return list(carton_program_search(name, name_type))

0 comments on commit 37ac3d4

Please sign in to comment.