Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

MBS-5767: Add an index on (editor, id DESC) #13

Closed
wants to merge 1 commit into from

3 participants

@ocharles
Owner

This allows /user/:user/edits to load without timing out.

@ocharles ocharles MBS-5767: Add an index on (editor, id DESC)
This allows /user/:user/edits to load without timing out.
ce4ae81
@ocharles
Owner

I haven't bothered with an upgrade script, because it's already applied.

@warpr
Owner

:shipit:

@ocharles ocharles closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2013
  1. @ocharles

    MBS-5767: Add an index on (editor, id DESC)

    ocharles authored
    This allows /user/:user/edits to load without timing out.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +3 −0  admin/sql/CreateIndexes.sql
  2. +1 −0  admin/sql/DropIndexes.sql
View
3  admin/sql/CreateIndexes.sql
@@ -53,6 +53,9 @@ CREATE INDEX edit_idx_status ON edit (status) WHERE status != 2;
CREATE INDEX edit_artist_idx_status ON edit_artist (status);
CREATE INDEX edit_label_idx_status ON edit_label (status);
+-- Index for viewing the latest edits for users
+CREATE INDEX edit_idx_editor_id_desc ON edit (editor, id DESC);
+
CREATE INDEX edit_open_time_date ON edit (date_trunc('day', open_time AT TIME ZONE 'UTC'));
CREATE INDEX edit_close_time_date ON edit (date_trunc('day', close_time AT TIME ZONE 'UTC'));
CREATE INDEX edit_expire_time_date ON edit (date_trunc('day', expire_time AT TIME ZONE 'UTC'));
View
1  admin/sql/DropIndexes.sql
@@ -29,6 +29,7 @@ DROP INDEX edit_artist_idx_status;
DROP INDEX edit_close_time_date;
DROP INDEX edit_expire_time_date;
DROP INDEX edit_idx_editor;
+DROP INDEX edit_idx_editor_id_desc;
DROP INDEX edit_idx_open_time;
DROP INDEX edit_idx_status;
DROP INDEX edit_idx_type;
Something went wrong with that request. Please try again.