Skip to content

Commit

Permalink
Create an index on can_start_at too
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopofar committed Mar 26, 2024
1 parent d9a05d8 commit 9074f61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions postgrestq/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ def _create_queue_table(self) -> None:
)"""
).format(sql.Identifier(self._table_name))
)
cur.execute(
sql.SQL(
"""CREATE INDEX IF NOT EXISTS
task_queue_can_start_at_idx
ON {} (can_start_at)
"""
).format(sql.Identifier(self._table_name))
)

def __len__(self) -> int:
"""
Expand Down

0 comments on commit 9074f61

Please sign in to comment.