Skip to content

Commit

Permalink
re-tune indexes (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis DeLosSantos authored May 20, 2020
1 parent 92a7a15 commit ab90d8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
31 changes: 9 additions & 22 deletions libvuln/migrations/migration1.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,15 @@ const (
version_kind TEXT,
UNIQUE (hash_kind, hash)
);
-- These are some guesses at useful indexes. These should be measured.
CREATE INDEX IF NOT EXISTS vuln_package_idx on vuln (
package_name,
package_kind,
package_version,
package_module
);
CREATE INDEX IF NOT EXISTS vuln_dist_idx on vuln (
dist_id,
dist_name,
dist_version,
dist_version_code_name,
dist_version_id,
dist_arch,
dist_cpe,
dist_pretty_name
);
CREATE INDEX IF NOT EXISTS vuln_repo_idx on vuln (
repo_name,
repo_key,
repo_uri
);
-- this index is tuned for the application. if you change this measure pre and post
-- change query speeds when generating vulnerability reports.
CREATE INDEX vuln_lookup_idx on vuln (package_name, dist_id,
dist_name, dist_pretty_name,
dist_version, dist_version_id,
package_module, dist_version_code_name,
repo_name, dist_arch,
dist_cpe, repo_key,
repo_uri);
-- Uo_vuln is the association table that does the many-many association
-- between update operations and vulnerabilities.
--
Expand Down
1 change: 0 additions & 1 deletion rhel/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func (*Matcher) Query() []driver.MatchConstraint {
// some database logic to compare CPEs and changing schema to be able to
// associate multiple CPEs with a given vulnerability.
return []driver.MatchConstraint{
//driver.PackageDistributionCPE,
driver.DistributionName,
driver.DistributionPrettyName,
driver.PackageModule,
Expand Down

0 comments on commit ab90d8e

Please sign in to comment.