New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command 'database:optimize-archive-tables' to optimize archive tables (even if on InnoDB). #8633

Merged
merged 4 commits into from Sep 3, 2015

Conversation

Projects
None yet
3 participants
@diosmosis
Member

diosmosis commented Aug 24, 2015

I added a quick command to make it easier to maintain or automate maintenance of Piwik. The command forces an optimization of one or more archive tables. I've noticed while supporting some users that even when using InnoDB, it can be necessary to rebuild archive tables. I also noticed, running the queries manually can be tedious and undesired (from the user's perspective), so I created this (small) command.

@diosmosis diosmosis added this to the 2.15.0 milestone Aug 24, 2015

@diosmosis

This comment has been minimized.

Show comment
Hide comment
@diosmosis

diosmosis Aug 31, 2015

Member

@tsteur Can you give this a quick review (or your thoughts if you don't think it should be merged)?

Member

diosmosis commented Aug 31, 2015

@tsteur Can you give this a quick review (or your thoughts if you don't think it should be merged)?

$output->writeln("Done.");
}
private function getTableMonthsToOptimize(InputInterface $input)

This comment has been minimized.

@tsteur

tsteur Sep 1, 2015

Member

Ideally the following private methods would be in a different class and public and therefore better testable in case we change eg ArchiveTableCreator somehow. Is it maybe otherwise possible to add a test for this command somehow?

@tsteur

tsteur Sep 1, 2015

Member

Ideally the following private methods would be in a different class and public and therefore better testable in case we change eg ArchiveTableCreator somehow. Is it maybe otherwise possible to add a test for this command somehow?

This comment has been minimized.

@diosmosis

diosmosis Sep 3, 2015

Member

This specific private method is for turning the arguments into a list of table months (ie, now => table month for Date::factory('now'), lastN => array(now, last month, etc...)).

I moved the code to convert a Date to a table month to ArchiveTableCreator though, since it should be there.

@diosmosis

diosmosis Sep 3, 2015

Member

This specific private method is for turning the arguments into a list of table months (ie, now => table month for Date::factory('now'), lastN => array(now, last month, etc...)).

I moved the code to convert a Date to a table month to ArchiveTableCreator though, since it should be there.

This comment has been minimized.

@diosmosis

diosmosis Sep 3, 2015

Member

Also added a test for the command.

@diosmosis

diosmosis Sep 3, 2015

Member

Also added a test for the command.

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur Sep 1, 2015

Member

Added some notes but up to you. Feel free to merge

Member

tsteur commented Sep 1, 2015

Added some notes but up to you. Feel free to merge

diosmosis added a commit that referenced this pull request Sep 3, 2015

Merge pull request #8633 from piwik/force_optimize_cmd
Add command to optimize archive tables (even if on InnoDB) since archive tables can get bloated even when purging functions normally.

@diosmosis diosmosis merged commit c63ac67 into master Sep 3, 2015

0 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
Scrutinizer Running Analyses
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@diosmosis diosmosis deleted the force_optimize_cmd branch Sep 3, 2015

@mattab mattab changed the title from Add command to optimize archive tables (even if on InnoDB). to New command 'database:optimize-archive-tables' to optimize archive tables (even if on InnoDB). Oct 13, 2015

@mattab mattab added the Major label Oct 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment