Skip to content

Commit

Permalink
Ajout de l'index sur parcelle_info voie - SUBSTR(voie,0,7)||SUBSTR(vo…
Browse files Browse the repository at this point in the history
…ie,12,4)
  • Loading branch information
mdouchin committed Aug 1, 2024
1 parent c28dd67 commit d549a14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cadastre/cadastre_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,9 @@ def endImport(self):
DROP INDEX IF EXISTS geo_batiment_centroide_geom_idx;
CREATE INDEX geo_parcelle_centroide_geom_idx ON geo_parcelle USING gist (ST_Centroid(geom));
CREATE INDEX geo_batiment_centroide_geom_idx ON geo_batiment USING gist (ST_Centroid(geom));
DROP INDEX IF EXISTS parcelle_info_voie_substr_idx;
CREATE INDEX parcelle_info_voie_substr_idx
ON parcelle_info ((SUBSTR(voie,0,7)||SUBSTR(voie,12,4)));
'''
sql = CadastreCommon.setSearchPath(sql, self.dialog.schema)
self.executeSqlQuery(sql)
Expand Down
4 changes: 2 additions & 2 deletions cadastre/dialogs/search_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def refreshAutocomplete(self, key):
def getFeaturesFromSqlQuery(self, layer, filterExpression=None, attributes='*', orderBy=None):
"""
Get data from a db table,
optionnally filtered by given expression
optionally filtered by given expression
and get corresponding QgsFeature objects
"""
QApplication.setOverrideCursor(Qt.WaitCursor)
Expand Down Expand Up @@ -855,7 +855,7 @@ def onSearchItemChoose(self, key, label, value):
QApplication.restoreOverrideCursor()
return None

# Set filter expression for parcell child data
# Set filter expression for parcelle child data
ckey = self.searchComboBoxes[key]['search']['parcelle_child']
if key == 'adresse':
filterExpression = "SUBSTR(voie,0,7)||SUBSTR(voie,12,4) = '%s%s'" % (value['voie'][0:6], value['voie'][11:])
Expand Down

0 comments on commit d549a14

Please sign in to comment.