Skip to content

Commit 9cd3816

Browse files
authored
Change Cache_expire_time to a partial index because we don't need to query rows efficiently where expire_time IS NULL (#305)
1 parent 323787f commit 9cd3816

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diskcache/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def __init__(self, directory=None, timeout=60, disk=Disk, **settings):
531531

532532
sql(
533533
'CREATE INDEX IF NOT EXISTS Cache_expire_time ON'
534-
' Cache (expire_time)'
534+
' Cache (expire_time) WHERE expire_time IS NOT NULL'
535535
)
536536

537537
query = EVICTION_POLICY[self.eviction_policy]['init']

0 commit comments

Comments
 (0)