Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizes some system generates queries based on casing annotations #648

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

mkeckmkeck
Copy link
Contributor

Uses lowercase and uppercase field annotations to optimize queries

  • When all values stored in a field are stored e.g. lowercased, we do not need
    to query case-insensitively. This can give a small speedup.
  • When all values in a field are stored e.g. lowercased, we do not need
    to query with an value containing upper case characters. We apply auto-magical
    case adaption on some cases where the framework generates queries. So we create
    the chance of actually finding an result, even if the input did not match the actual db field.
    This is relevant, e.g. for the Sirius biz virtual filesystem backend ui. There, the normalized
    filename field of a sql blob containing only lowercase characters might get queried by user input
    containing the exact filename. By this adaption, we are able to find the blob.
  • For regular API usage, such magic from framework is not desired. If required, apply it by
    yourself when creating queries.

- When all values stored in a field are stored e.g. lowercased, we do not need
  to query case-insensitively. This can give a small speedup.
- When all values in a field are stored e.g. lowercased, we do not need
  to query with an value containing upper case characters. We apply auto-magical
  case adaption on some cases where the framework generates queries. So we create
  the chance of actually finding an result, even if the input did not match the actual db field.
  This is relevant, e.g. for the Sirius biz virtual filesystem backend ui. There, the normalized
  filename field of a sql blob containing only lowercase characters might get queried by user input
  containing the exact filename. By this adaption, we are able to find the blob.
- For regular API usage, such magic from framework is not desired. If required, apply it by
  yourself when creating queries.

Fixes: SIRI-951
@mkeckmkeck mkeckmkeck added the 🧬 Enhancement Contains new features label Apr 9, 2024
@mkeckmkeck mkeckmkeck merged commit 23a3f98 into develop Apr 9, 2024
4 checks passed
@mkeckmkeck mkeckmkeck deleted the feature/SIRI-951_optimize_queries_casing branch April 9, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧬 Enhancement Contains new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants