· 8 years ago · Jun 20, 2018, 03:38 PM
1CREATE TEMPORARY TABLE IF NOT EXISTS TTTe5f0f36ca5fec1d49a75d5cb5d88233f
2 (repID INT,StoreID INT,EntityID INT , INDEX st (`StoreID`) ) engine=memory
3 AS
4 SELECT ass_.AssociatedObjectID AS repID, ass_.OwnerUsergroupID AS EntityID,
5 ent_.MVStoreID AS StoreID, 1 as assignmentCount FROM MVAssignment AS ass_
6 JOIN
7 TTTf122b1fd3249346930db2dff0c43b022 existsTT on existsTT.ID = ass_.AssociatedObjectID
8 JOIN MVList_Stores as list_stores ON ass_.AssignmentValue = list_stores.MVListID
9 JOIN MVMasterEntity_AttachedStores ent_ ON ent_.MVStoreID = list_stores.MVStoreID
10 WHERE ass_.AssociatedObjectClass = 'MVRep' AND ass_.AssignmentSubType = 'ListID' AND ass_.IsDeleted = 0 AND EXISTS (select StoreID from TTT08d81ab1ab02c079ffebae286c342e62 existsTT where ent_.MVStoreID=existsTT.StoreID) ; /* queryTime - 15.1777 seconds */
11
12id select_type table type possible_keys key key_len ref rows Extra
131 PRIMARY existsTT ALL ID 20024 Using where
141 PRIMARY ass_ ref assignmentQuery,joshTest,testTwo,joshTest3,anodaTEst,uniqueness,uutt,AssignmentValue,AssociatedObjectID,AssociatedObject testTwo 4 benchmark.existsTT.ID 1 Using index condition
151 PRIMARY list_stores ref StoreList,MVListID,MVStoreID MVListID 4 benchmark.ass_.AssignmentValue 1 Using index condition
161 PRIMARY ent_ ref MVStoreID MVStoreID 4 benchmark.list_stores.MVStoreID 1 Using where; Using index
172 DEPENDENT SUBQUERY existsTT ref st st 5 benchmark.ent_.MVStoreID 2