Skip to content

inspect data is not used for caching database hash #1834

@fgregg

Description

@fgregg

When databases are loaded,

datasette/datasette/app.py

Lines 257 to 260 in cb1e093

for file in self.files:
self.add_database(
Database(self, file, is_mutable=file not in self.immutables)
)

there is nothing preventing the rehashing of the database for immutable databases.

if not self.is_mutable and not self.is_memory:
p = Path(path)
self.hash = inspect_hash(p)
self.cached_size = p.stat().st_size

what i might expect is that relevant values of inspect_data get passed to the Database class to prevent re-hashing?

With data that is many gigs large, this is a significant start up time.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions