为表提供的索引不起作用,创建deadlock.please的sql查询帮助我。
sql查询:
UPDATE APA_Pended_Demand
SET APA_Pended_Demand.genericDemandId=(
SELECT APA_Generic_Demand_Details.genericDemandId
FROM APA_Generic_Demand_Details
WHERE APA_Generic_Demand_Details.demandID=APA_Pended_Demand.demandID
AND APA_Pended_Demand.isPend = 1
AND APA_Generic_Demand_Details.genericDemandId != ''
AND APA_Generic_Demand_Details.genericDemandId IS NOT NULL
AND APA_Pended_Demand.reactivateDate > UTC_TIMESTAMP()
AND APA_Generic_Demand_Details.status < 300
AND APA_Pended_Demand.ID BETWEEN 1 AND 10000
索引是:
PRIMARY KEY (`id`),
KEY `apgnricdmnddetils_prdcttype` (`productType`),
KEY `apgnricdmnddtils_srcereqrle` (`sourceReqRole`),
KEY `apgnericdemnddetils_methdin` (`methodIn`),
KEY `apgnricdemnddetils_bndnresn` (`abandonReason`),
KEY `IX1_APA_Generic_Demand_Details` (`status`,`customerReference`,`policyNo`,`genericDemandId`) USING BTREE,
KEY `IX2_APA_Generic_Demand_Details` (`status`,`schemeReference`,`genericDemandId`) USING BTREE,
KEY `IX3_APA_Generic_Demand_Details` (`status`,`aggregationKey`,`genericDemandId`) USING BTREE,
KEY `IX4_APA_Generic_Demand_Details` (`status`,`initiator`,`aggregationKey`,`genericDemandId`) USING BTREE,
KEY `IX5_APA_Generic_Demand_Details` (`status`,`policyNo`,`genericDemandId`) USING BTREE,
KEY `IX6_APA_Generic_Demand_Details_Status` (`status`) USING BTREE,
KEY `IX7_APA_Generic_Demand_Details` (`genericDemandId`),
KEY `IX8_APA_Generic_Demand_Details` (`initiator`,`status`) USING BTREE,
KEY `status` (`status`),
KEY `IX9_APA_Generic_Demand_Details` (`customerReference`,`status`) USING BTREE,
CONSTRAINT `apgnericdemnddetils_methdin` FOREIGN KEY (`methodIn`) REFERENCES `APA_REF_CONTACT_METHOD` (`METHOD_ID`),
CONSTRAINT `apgnricdemnddetils_bndnresn` FOREIGN KEY (`abandonReason`) REFERENCES `APA_REF_ABANDON_REASON` (`REASON_ID`),
CONSTRAINT `apgnricdmnddetils_prdcttype` FOREIGN KEY (`productType`) REFERENCES `APA_REF_PRODUCT_TYPE` (`PRODUCTTYPE_ID`),
CONSTRAINT `apgnricdmnddtils_srcereqrle` FOREIGN KEY (`sourceReqRole`) REFERENCES `APA_REF_CUSTOMER_CONTACTS` (`CUSTOMER_CONTACT_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=14469 DEFAULT CHARSET=utf8