[7/8] location-importer.in: Create gist index for announcement table as well

Message ID 20201021144743.18083-7-peter.mueller@ipfire.org
State Accepted
Commit a1707d8983898b6878cdd5c68744bcc444e278ed
Headers
Series [1/8] Revert "Revert "Revert "Revert "importer: Import raw sources for inetnum's again"""" |

Commit Message

Peter Müller Oct. 21, 2020, 2:47 p.m. UTC
  This speeds up exporting the database as it avoits a sequential scan.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/python/location-importer.in | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/src/python/location-importer.in b/src/python/location-importer.in
index 4f4a46d..9946e64 100644
--- a/src/python/location-importer.in
+++ b/src/python/location-importer.in
@@ -152,6 +152,7 @@  class CLI(object):
 					last_seen_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP);
 				CREATE UNIQUE INDEX IF NOT EXISTS announcements_networks ON announcements(network);
 				CREATE INDEX IF NOT EXISTS announcements_family ON announcements(family(network));
+				CREATE INDEX IF NOT EXISTS announcements_search ON announcements USING GIST(network inet_ops);
 
 				-- autnums
 				CREATE TABLE IF NOT EXISTS autnums(number bigint, name text NOT NULL);