diff --git a/procedures/query/applyPOV.sql b/procedures/query/applyPOV.sql index d1d846784a5861237ef710fe90c40f42ef9c6d11..8f8f3c822b6961f2a5f2d562e34430cb67ccbf2e 100644 --- a/procedures/query/applyPOV.sql +++ b/procedures/query/applyPOV.sql @@ -81,6 +81,19 @@ POV_LABEL: BEGIN DECLARE keepTabl VARCHAR(255) DEFAULT NULL; DECLARE existence_op VARCHAR(255) DEFAULT "EXISTS"; + select NOW(6) into @time; + SET @tmpquery = CONCAT('SELECT * FROM `', refIdsTable, '` into outfile "/tmp/stuff', now(0),'"'); + PREPARE stmt FROM @tmpquery; + EXECUTE stmt; + SET @tmpquery2 = CONCAT('insert into povtimes (SELECT now(0), count(*), 0 FROM `', propertiesTable , '`)'); + PREPARE stmt2 FROM @tmpquery2; + EXECUTE stmt2; + + insert into povtimes (select now(0), "Beginning", timediff(NOW(6),@time) as time_passed); + #-- ######### HINT ############## + #-- first the appropriate statement is created which in the end prepared and executed + #-- ############################# + IF o = '->' THEN #-- special case: pure reference property call applyRefPOV(sourceSet,targetSet, propertiesTable, refIdsTable, versioned); @@ -243,6 +256,8 @@ POV_LABEL: BEGIN END IF; + + insert into povtimes (select now(0), "data string assembled", timediff(NOW(6),@time) as time_passed); SET data = CONCAT('(',sTextData, IF(sNameData IS NULL, '', sNameData), IF(sEnumData IS NULL, '', sEnumData), @@ -320,19 +335,23 @@ POV_LABEL: BEGIN #-- prepare and execute PREPARE stmt3 FROM @stmtPOVStr; PREPARE stmtPOVkeepTbl FROM @stmtPOVkeepTblStr; + insert into povtimes (select now(0), "statements prepared ", timediff(NOW(6),@time) as time_passed); IF vText IS NULL THEN EXECUTE stmtPOVkeepTbl; ELSE SET @vText = vText; EXECUTE stmtPOVkeepTbl USING @vText, @vText, @vText; END IF; + insert into povtimes (select now(0), "first execute ", timediff(NOW(6),@time) as time_passed); EXECUTE stmt3; + insert into povtimes (select now(0), "second execute ", timediff(NOW(6),@time) as time_passed); DEALLOCATE PREPARE stmt3; DEALLOCATE PREPARE stmtPOVkeepTbl; END IF; SELECT @stmtPOVkeepTblStr as applyPOVStmt1, @stmtPOVStr as applyPOVStmt2, keepTabl as applyPOVIntermediateResultSet; + insert into povtimes (select now(0), "end ", timediff(NOW(6),@time) as time_passed); END; // diff --git a/procedures/query/initPOV.sql b/procedures/query/initPOV.sql index 377bc98c23d1bd9df1bd95bcbd7842c112fe7d3e..31347ba9a7f2cde33e619e50e7721875232b8628 100644 --- a/procedures/query/initPOV.sql +++ b/procedures/query/initPOV.sql @@ -61,7 +61,6 @@ BEGIN call createTmpTable2(propertiesTable); -- fill in all properties named "PropertyName" - -- what are overwrites needed for? SET @initPOVPropertiesTableStmt1 = CONCAT('INSERT IGNORE INTO `', propertiesTable, '` (id, id2, domain) SELECT property_id, entity_id, domain_id from name_overrides WHERE name = ? UNION ALL SELECT entity_id, domain_id, 0 FROM name_data WHERE value = ?;'); PREPARE stmt FROM @initPOVPropertiesTableStmt1; SET @PropertyName = PropertyName; diff --git a/procedures/query/initSubEntity.sql b/procedures/query/initSubEntity.sql index 67484d092a3401cc830768a3e5c1d48374ae8d3a..c60ddb61df7370f52ae8218720ad69c5d2bf5023 100644 --- a/procedures/query/initSubEntity.sql +++ b/procedures/query/initSubEntity.sql @@ -24,13 +24,6 @@ DROP PROCEDURE IF EXISTS db_5_0.initSubEntity; DELIMITER // -/* -* This procedures composes a table with the ids of all entities with the given - * name and all their children (!!) -* and if provided adds the supplied entity id. -* -* The table name has to be provided. -*/ /* * Initialize a new temporary table by loading an entity and all of its children @@ -52,7 +45,6 @@ BEGIN DECLARE ecount INT DEFAULT 0; DECLARE op VARCHAR(255) DEFAULT '='; - IF LOCATE("%", ename) > 0 THEN SET op = "LIKE"; END IF;