Skip to content

Commit

Permalink
Change Cache_expire_time to a partial index because we don't need t…
Browse files Browse the repository at this point in the history
…o query rows efficiently `where expire_time IS NULL` (#305)
  • Loading branch information
ddorian authored Feb 26, 2024
1 parent 323787f commit 9cd3816
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diskcache/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def __init__(self, directory=None, timeout=60, disk=Disk, **settings):

sql(
'CREATE INDEX IF NOT EXISTS Cache_expire_time ON'
' Cache (expire_time)'
' Cache (expire_time) WHERE expire_time IS NOT NULL'
)

query = EVICTION_POLICY[self.eviction_policy]['init']
Expand Down

0 comments on commit 9cd3816

Please sign in to comment.