Resolve "Usage Ping timeouts on security_products_usage for large hosts"
requested to merge 208697-usage-ping-timeouts-on-security_products_usage-for-large-hosts into master
What does this MR do?
Improves the secure queries for large hosts by adding batching and separating queries for each counter.
before query:
- query itself: https://paste.depesz.com/s/V4C
- explain(
database-lab
) - https://explain.depesz.com/s/CEZi - simulatedcount
withCOUNT(*)
after query:
- query(one of many with similar fields) - https://paste.depesz.com/s/pgJ
container_scanning
- explain(
database-lab
) - https://explain.depesz.com/s/OmsI
dast
- explain(
database-lab
) - https://explain.depesz.com/s/famP
dependency_scanning
- explain(
database-lab
) - https://explain.depesz.com/s/EVJg
license_management
- explain(
database-lab
) - https://explain.depesz.com/s/SOsh
license_scanning
- explain(
database-lab
) - https://explain.depesz.com/s/UhxM
sast
- explain(
database-lab
) - https://explain.depesz.com/s/9SYf
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #208697 (closed)
Edited by Thong Kuah