aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-09-01 21:27:59 +0200
committerMario Vavti <mario@mariovavti.com>2017-09-01 21:27:59 +0200
commite935473c5c05a40194c110fbb024825a30ca5a4b (patch)
tree0795a3d546c8294d2f14a64e2d3e206cbe4b8e05 /install/update.php
parent3af3b36db3ef1ab0f8b5987a13d9adca482d0952 (diff)
downloadvolse-hubzilla-e935473c5c05a40194c110fbb024825a30ca5a4b.tar.gz
volse-hubzilla-e935473c5c05a40194c110fbb024825a30ca5a4b.tar.bz2
volse-hubzilla-e935473c5c05a40194c110fbb024825a30ca5a4b.zip
add combined index for item.uid and item.item_unseen. this speeds up notifications by a magnitude.
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index 8798a3d69..b99e4dd9d 100644
--- a/install/update.php
+++ b/install/update.php
@@ -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;
+}