[Backend]新增索引,改善查詢超時

This commit is contained in:
張家睿 2024-08-09 09:15:23 +08:00
parent d2baf9b87b
commit 08f341ca39

View File

@ -1818,8 +1818,9 @@ CREATE TABLE `import_niagara_item_history` (
`full_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`check_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 271 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_device_number` (`device_number`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;";
using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))