faster sql (removed sub-select)

This commit is contained in:
jygaulier
2020-12-10 18:46:04 +01:00
parent 9e384381bc
commit 9e63fb0195

View File

@@ -1564,7 +1564,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$stmt->execute([':record_id' => $this->getRecordId()]);
$stmt->closeCursor();
$sql = "DELETE FROM permalinks WHERE subdef_id IN (SELECT subdef_id FROM subdef WHERE record_id=:record_id)";
$sql = "DELETE permalinks FROM subdef INNER JOIN permalinks USING(subdef_id) WHERE record_id=:record_id";
$stmt = $connection->prepare($sql);
$stmt->execute([':record_id' => $this->getRecordId()]);
$stmt->closeCursor();