Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2018-02-24 02:50:20 +0300
committerHolger Weiss <holger@zedat.fu-berlin.de>2018-02-24 02:50:20 +0300
commitf7566bd00e687df60fd470b9fdfc5ce6b04f0c7c (patch)
tree699db516e8fbdcdf11d998fe57e9aaa3ced0a078 /sql/pg.sql
parent5bf753fd2d9c54f36b4bc3e6ec9176584c50e9aa (diff)
sql/*: Add username to peer indexes
The username is available for all MAM queries in question, and adding it to the indexes can improve the lookup performance significantly.
Diffstat (limited to 'sql/pg.sql')
-rw-r--r--sql/pg.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/pg.sql b/sql/pg.sql
index 48f4a85d4..16456fe0f 100644
--- a/sql/pg.sql
+++ b/sql/pg.sql
@@ -102,9 +102,9 @@ CREATE TABLE archive (
);
CREATE INDEX i_username_timestamp ON archive USING btree (username, timestamp);
+CREATE INDEX i_username_peer ON archive USING btree (username, peer);
+CREATE INDEX i_username_bare_peer ON archive USING btree (username, bare_peer);
CREATE INDEX i_timestamp ON archive USING btree (timestamp);
-CREATE INDEX i_peer ON archive USING btree (peer);
-CREATE INDEX i_bare_peer ON archive USING btree (bare_peer);
CREATE TABLE archive_prefs (
username text NOT NULL PRIMARY KEY,