Performance: Indizes für alle Suchfelder hinzugefügt
This commit is contained in:
18
app.py
18
app.py
@@ -54,12 +54,18 @@ def init_db():
|
|||||||
)
|
)
|
||||||
''')
|
''')
|
||||||
|
|
||||||
# Erstelle Indizes für häufig durchsuchte Spalten
|
# Erstelle Indizes für alle Suchfelder
|
||||||
c.execute('CREATE INDEX IF NOT EXISTS idx_name ON customers(name)')
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_nummer ON customers(nummer)')
|
||||||
c.execute('CREATE INDEX IF NOT EXISTS idx_ort ON customers(ort)')
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_name ON customers(name)')
|
||||||
c.execute('CREATE INDEX IF NOT EXISTS idx_nummer ON customers(nummer)')
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_strasse ON customers(strasse)')
|
||||||
c.execute('CREATE INDEX IF NOT EXISTS idx_telefon ON customers(telefon)')
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_plz ON customers(plz)')
|
||||||
c.execute('CREATE INDEX IF NOT EXISTS idx_email ON customers(email)')
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_ort ON customers(ort)')
|
||||||
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_telefon ON customers(telefon)')
|
||||||
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_mobil ON customers(mobil)')
|
||||||
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_email ON customers(email)')
|
||||||
|
|
||||||
|
# Erstelle einen zusammengesetzten Index für die häufigste Suchkombination
|
||||||
|
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_name_ort ON customers(name, ort)')
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
Reference in New Issue
Block a user