mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Use optimized update statements
This commit is contained in:
parent
557d0e3aeb
commit
5be9c9dbaf
8 changed files with 83 additions and 51 deletions
|
@ -1781,6 +1781,24 @@ class Database
|
|||
return $this->e("OPTIMIZE TABLE " . DBA::buildTableString([$table])) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kill sleeping database processes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteSleepingProcesses()
|
||||
{
|
||||
$processes = $this->p("SHOW FULL PROCESSLIST");
|
||||
while ($process = $this->fetch($processes)) {
|
||||
if (($process['Command'] != 'Sleep') || ($process['Time'] < 300) || ($process['db'] != $this->databaseName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->e("KILL ?", $process['Id']);
|
||||
}
|
||||
$this->close($processes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a database variable
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue