create db index on hot column
This commit is contained in:
@@ -16,6 +16,7 @@ CREATE TABLE IF NOT EXISTS detections (
|
|||||||
Overlap FLOAT,
|
Overlap FLOAT,
|
||||||
File_Name VARCHAR(100) NOT NULL);
|
File_Name VARCHAR(100) NOT NULL);
|
||||||
CREATE INDEX "detections_Com_Name" ON "detections" ("Com_Name");
|
CREATE INDEX "detections_Com_Name" ON "detections" ("Com_Name");
|
||||||
|
CREATE INDEX "detections_Sci_Name" ON "detections" ("Sci_Name");
|
||||||
CREATE INDEX "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
|
CREATE INDEX "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
|
||||||
EOF
|
EOF
|
||||||
chown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.db
|
chown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.db
|
||||||
|
|||||||
@@ -215,6 +215,10 @@ if ! [ -L $HOME/BirdNET-Pi/model/labels.txt ]; then
|
|||||||
sudo_with_user install_language_label.sh
|
sudo_with_user install_language_label.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sqlite3 $HOME/BirdNET-Pi/scripts/birds.db << EOF
|
||||||
|
CREATE INDEX IF NOT EXISTS "detections_Sci_Name" ON "detections" ("Sci_Name");
|
||||||
|
EOF
|
||||||
|
|
||||||
# update snippets above
|
# update snippets above
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
Reference in New Issue
Block a user