add combined index for item.uid and item.item_unseen. this speeds up notifications by a magnitude.

This commit is contained in:
Mario Vavti
2017-09-01 21:27:59 +02:00
parent 3af3b36db3
commit e935473c5c
7 changed files with 27 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1193 );
define( 'UPDATE_VERSION' , 1194 );
/**
*
@@ -2978,3 +2978,17 @@ function update_r1192() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
function update_r1193() {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("CREATE INDEX item_uid_unseen ON item (uid, item_unseen)");
}
else {
$r1 = q("ALTER TABLE item ADD INDEX uid_item_unseen (uid, item_unseen);");
}
if($r1)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}