mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
add event-id index to prevent large CPU loads when visiting the events page
This commit is contained in:
parent
c9cce9873d
commit
3f77eb80fe
3 changed files with 19 additions and 2 deletions
18
update.php
18
update.php
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
define( 'UPDATE_VERSION' , 1158 );
|
||||
define( 'UPDATE_VERSION' , 1159 );
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -1386,3 +1386,19 @@ function update_1157() {
|
|||
return UPDATE_FAILED;
|
||||
}
|
||||
|
||||
function update_1158() {
|
||||
set_config('system', 'maintenance', 1);
|
||||
|
||||
// Wait for 15 seconds for current requests to
|
||||
// clear before locking up the database
|
||||
sleep(15);
|
||||
|
||||
$r = q("CREATE INDEX event_id ON item(`event-id`)");
|
||||
set_config('system', 'maintenance', 0);
|
||||
|
||||
if($r)
|
||||
return UPDATE_SUCCESS;
|
||||
|
||||
return UPDATE_FAILED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue