From 568316f07cc3ca06ce444bd6aa8326f252e66819 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 12 Jul 2021 14:47:50 +0200 Subject: [PATCH] simplify analyse function --- nominatim/indexer/indexer.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nominatim/indexer/indexer.py b/nominatim/indexer/indexer.py index 5ab0eac3..76883500 100644 --- a/nominatim/indexer/indexer.py +++ b/nominatim/indexer/indexer.py @@ -92,7 +92,7 @@ class Indexer: def index_full(self, analyse=True): - """ Index the complete database. This will first index boudnaries + """ Index the complete database. This will first index boundaries followed by all other objects. When `analyse` is True, then the database will be analysed at the appropriate places to ensure that database statistics are updated. @@ -100,13 +100,10 @@ class Indexer: with connect(self.dsn) as conn: conn.autocommit = True - if analyse: - def _analyze(): + def _analyze(): + if analyse: with conn.cursor() as cur: cur.execute('ANALYZE') - else: - def _analyze(): - pass self.index_by_rank(0, 4) _analyze() -- 2.39.5