Milimetric has uploaded a new change for review. https://gerrit.wikimedia.org/r/160031
Change subject: Speed up admin script by adding an index ...................................................................... Speed up admin script by adding an index Bug: 70775 Change-Id: Id5489291455243f604e316db83f106f0578720d5 --- A database_migrations/versions/1ba1b62367d4_add_index_on_reports_recurrent.py M scripts/admin 2 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics refs/changes/31/160031/1 diff --git a/database_migrations/versions/1ba1b62367d4_add_index_on_reports_recurrent.py b/database_migrations/versions/1ba1b62367d4_add_index_on_reports_recurrent.py new file mode 100644 index 0000000..a1e96da --- /dev/null +++ b/database_migrations/versions/1ba1b62367d4_add_index_on_reports_recurrent.py @@ -0,0 +1,25 @@ +"""Add index on reports.recurrent + +Revision ID: 1ba1b62367d4 +Revises: 2f1dcf6b94a9 +Create Date: 2014-09-12 13:16:20.754399 + +""" + +# revision identifiers, used by Alembic. +revision = '1ba1b62367d4' +down_revision = '2f1dcf6b94a9' + +from alembic import op + + +def upgrade(): + op.create_index( + 'ix_report_recurrent', + 'report', + ['recurrent'] + ) + + +def downgrade(): + op.drop_index('ix_report_recurrent', 'report') diff --git a/scripts/admin b/scripts/admin index 03adb20..2d5a244 100755 --- a/scripts/admin +++ b/scripts/admin @@ -384,6 +384,7 @@ ) # Do not create duplicate reports (we can add an option to force later) existing = session.query(ReportStore)\ + .filter(ReportStore.recurrent == 1)\ .filter(ReportStore.name == parameters['name'])\ .filter(ReportStore.user_id == args.user.id)\ .count() -- To view, visit https://gerrit.wikimedia.org/r/160031 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5489291455243f604e316db83f106f0578720d5 Gerrit-PatchSet: 1 Gerrit-Project: analytics/wikimetrics Gerrit-Branch: master Gerrit-Owner: Milimetric <dandree...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits