Skip to content

Avoid redundant checks for validating custom SQL queries #451

@rydnr

Description

@rydnr

Information

Currently, the biggest bottleneck is the validation of the SQL queries, which is O(n). QueryJ could calculate a hash for each query which gets validated correctly, so that afterwards such hashes could be cached and used to avoid unnecessary database access.

Actions required

  • Write the code to calculate a hash for each SQL query. The hash can be used as hashCode() implementation, surviving restarts.
  • The hash is cached on disk if the validation succeeds.
  • Before validating the query, the hash is checked and used to skip the validation.

Steps to reproduce

  • There's no way to reliable obtain a value identifying each query uniquely.
  • Consecutive executions take the same time.

Acceptance criteria

  • The Sql API provides a method to obtain its hash.
  • QueryJ runs much faster after the hashes have been computed and cached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions