From: Michael Tremer Date: Thu, 24 Sep 2020 10:17:58 +0000 (+0000) Subject: Revert "importer: Purge any redundant entries" X-Git-Tag: 0.9.5~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee6ea3986dc80183157f67275dc9f28231b5d5b2;p=people%2Fms%2Flibloc.git Revert "importer: Purge any redundant entries" This reverts commit c2cc55d5a6875c3838f060032eaed89dcfb92ef6. The query stalls the database and therefore the automatic scripts are no longer able to generate a new version of the database. Signed-off-by: Michael Tremer --- diff --git a/src/python/location-importer.in b/src/python/location-importer.in index 1467923..e3a07a0 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -374,27 +374,7 @@ class CLI(object): INSERT INTO autnums(number, name) SELECT _autnums.number, _organizations.name FROM _autnums JOIN _organizations ON _autnums.organization = _organizations.handle - ON CONFLICT (number) DO UPDATE SET name = excluded.name - """) - - self.db.execute(""" - --- Purge any redundant entries - CREATE TEMPORARY TABLE _garbage ON COMMIT DROP - AS - SELECT network FROM networks candidates - WHERE EXISTS ( - SELECT FROM networks - WHERE - networks.network << candidates.network - AND - networks.country = candidates.country - ); - - CREATE UNIQUE INDEX _garbage_search ON _garbage USING BTREE(network); - - DELETE FROM networks WHERE EXISTS ( - SELECT FROM _garbage WHERE networks.network = _garbage.network - ); + ON CONFLICT (number) DO UPDATE SET name = excluded.name; """) # Download all extended sources