Skip to content

Replace SELECT * with explicit column lists in metadata queries #5

@deepjoy

Description

@deepjoy

Description

SQL queries in the metadata layer use SELECT *, which loads all columns including potentially heavy ones like metadata JSON blobs. This is wasteful when only a subset of columns is needed (e.g., listing object keys).

Location

  • src/metadata/sqlite.rs:74

Details

Queries like:

sqlx::query_as::<_, ObjectRecord>("SELECT * FROM objects WHERE key = ?")

should be replaced with explicit column lists to:

  • Avoid loading heavy columns (e.g., metadata JSON) when not needed
  • Improve query performance for list operations
  • Make the code more resilient to schema changes

Acceptance Criteria

  • Audit all SELECT * queries in sqlite.rs
  • Replace with explicit column lists
  • Consider adding lightweight query variants for list/prefix operations that skip heavy columns

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions