Skip to content
Snippets Groups Projects
Verified Commit 0e63717c authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Let the flow tagger use the same index as archivist

Then we can drop the other index, as it is not used.
parent 7765fa4e
Branches
1 merge request!17Let the flow tagger use the same index as archivist
......@@ -322,7 +322,6 @@ CREATE TABLE biflows (
CREATE SEQUENCE biflow_ids OWNED BY biflows.id;
ALTER TABLE biflows ALTER COLUMN id SET DEFAULT NEXTVAL('biflow_ids');
CREATE INDEX ON biflows (ip_remote);
CREATE INDEX ON biflows (tag);
CREATE INDEX ON biflows (tagged_on);
CREATE INDEX ON biflows (client);
CREATE INDEX ON biflows (port_remote, proto);
......
......@@ -27,7 +27,7 @@ while (<>) {
}
my $dbh = DBI->connect("dbi:Pg:dbname=turris", "tagger", "", { RaiseError => 1, AutoCommit => 0 });
my $read = $dbh->prepare('SELECT id, ip_remote, port_remote FROM biflows WHERE tag IS NULL LIMIT 100000');
my $read = $dbh->prepare('SELECT id, ip_remote, port_remote FROM biflows WHERE tagged_on IS NULL LIMIT 100000');
my $update = $dbh->prepare('UPDATE biflows SET tag = ?, tagged_on = ? WHERE id = ?');
my $anomalies = $dbh->prepare('SELECT DISTINCT value, type FROM anomalies WHERE relevance_count >= ?');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment