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

perf(APIv2): additional optimizations and cleanup for searches #2324

Closed
wants to merge 1 commit into from

Conversation

skateman
Copy link
Member

@skateman skateman commented Nov 27, 2024

With the help of @dkuc I was able to further optimise some (NOT) IN subqueries, mainly used for searching. This pattern should be further used in the remaining search definitions and all the raw SQL ones can be eliminated.

From:

(inventory.hosts.id IN (SELECT policy_systems.system_id FROM policy_systems) 

To:

EXISTS(SELECT 1 FROM policy_systems WHERE policy_systems.system_id = inventory.hosts.id)

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

@skateman skateman requested a review from a team as a code owner November 27, 2024 13:05
@skateman skateman closed this Jan 1, 2025
@skateman skateman deleted the optimize-queries branch January 1, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant