improve vulnerablesoftware cpe normalization performance

Signed-off-by: Steffen Ohrendorf <steffen.ohrendorf@gmx.de>
This commit is contained in:
Steffen Ohrendorf 2025-10-17 18:51:50 +02:00
parent 61a4cf9096
commit 8e8691c1fa
No known key found for this signature in database
GPG key ID: 9C0FC25E33CE86A8

View file

@ -43,7 +43,13 @@ public class v4135Updater extends AbstractUpgradeItem {
try (final Statement statement = connection.createStatement()) { try (final Statement statement = connection.createStatement()) {
LOGGER.info("Normalizing \"VULNERABLESOFTWARE\" CPE columns"); LOGGER.info("Normalizing \"VULNERABLESOFTWARE\" CPE columns");
statement.execute(/* language=SQL */ """ statement.execute(/* language=SQL */ """
UPDATE "VULNERABLESOFTWARE" SET "PART" = LOWER("PART"), "VENDOR" = LOWER("VENDOR"), "PRODUCT" = LOWER("PRODUCT") UPDATE "VULNERABLESOFTWARE"
SET "PART" = LOWER("PART"),
"VENDOR" = LOWER("VENDOR"),
"PRODUCT" = LOWER("PRODUCT")
WHERE "PART" <> LOWER("PART")
OR "VENDOR" <> LOWER("VENDOR")
OR "PRODUCT" <> LOWER("PRODUCT")
"""); """);
} }
} }