]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Revert "importer: Purge any redundant entries"
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Sep 2020 10:17:58 +0000 (10:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Sep 2020 10:18:23 +0000 (10:18 +0000)
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 <michael.tremer@ipfire.org>
src/python/location-importer.in

index 1467923475d2b1609ddf10e28f9f117900e4aec9..e3a07a07c65eddb7a64f28b49b0ed6a8914c28b5 100644 (file)
@@ -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