From 22a1a4625930b6e4f82d36ad4801c2bc541324b0 Mon Sep 17 00:00:00 2001 From: mrepetto Date: Thu, 19 Sep 2019 19:48:23 -0300 Subject: [PATCH] named more indexes --- dejavu/database_handler/mysql_queries.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dejavu/database_handler/mysql_queries.py b/dejavu/database_handler/mysql_queries.py index a156c31..ee27f3e 100644 --- a/dejavu/database_handler/mysql_queries.py +++ b/dejavu/database_handler/mysql_queries.py @@ -59,8 +59,9 @@ CREATE_FINGERPRINTS_TABLE = f""" , `{FIELD_OFFSET}` INT UNSIGNED NOT NULL , `date_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , `date_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - , INDEX (`{FIELD_HASH}`) - , CONSTRAINT `uq_{FINGERPRINTS_TABLENAME}` UNIQUE KEY (`{FIELD_SONG_ID}`, `{FIELD_OFFSET}`, `{FIELD_HASH}`) + , INDEX `ix_{FINGERPRINTS_TABLENAME}_{FIELD_HASH}` (`{FIELD_HASH}`) + , CONSTRAINT `uq_{FINGERPRINTS_TABLENAME}_{FIELD_SONG_ID}_{FIELD_OFFSET}_{FIELD_HASH}` + UNIQUE KEY (`{FIELD_SONG_ID}`, `{FIELD_OFFSET}`, `{FIELD_HASH}`) , CONSTRAINT `fk_{FINGERPRINTS_TABLENAME}_{FIELD_SONG_ID}` FOREIGN KEY (`{FIELD_SONG_ID}`) REFERENCES `{SONGS_TABLENAME}`(`{FIELD_SONG_ID}`) ON DELETE CASCADE ) ENGINE=INNODB;