mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
faster sql (removed sub-select)
This commit is contained in:
@@ -1564,7 +1564,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
|||||||
$stmt->execute([':record_id' => $this->getRecordId()]);
|
$stmt->execute([':record_id' => $this->getRecordId()]);
|
||||||
$stmt->closeCursor();
|
$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 = $connection->prepare($sql);
|
||||||
$stmt->execute([':record_id' => $this->getRecordId()]);
|
$stmt->execute([':record_id' => $this->getRecordId()]);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
Reference in New Issue
Block a user