]> git.openstreetmap.org Git - nominatim.git/commitdiff
work around strange query planning behaviour
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 26 Mar 2024 08:57:24 +0000 (09:57 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 26 Mar 2024 08:57:24 +0000 (09:57 +0100)
nominatim/tokenizer/icu_tokenizer.py

index 251f4da5df3cbe7319a622d2b97d16415ff7f5a4..9032d71b9069c5210d625ae21641f835610c0423 100644 (file)
@@ -163,6 +163,8 @@ class ICUTokenizer(AbstractTokenizer):
                 else:
                     LOG.info('Computing word frequencies')
                     cur.drop_table('word_frequencies')
+                    cur.execute('ANALYSE search_name')
+                    cur.execute('ANALYSE word')
                     cur.execute("""
                       CREATE TEMP TABLE word_frequencies AS
                       WITH word_freq AS MATERIALIZED (
@@ -190,6 +192,7 @@ class ICUTokenizer(AbstractTokenizer):
                                             END) as info
                                     FROM word LEFT JOIN word_frequencies wf
                                          ON word.word_id = wf.id
+                                    ORDER BY word_id
                                 """)
                     cur.drop_table('word_frequencies')