We're using gitlabhq quite intensively at our company.
I notices increasingly bad performance directly related to the mysql database.
After analyzing the queries with the slow log i came to the conclusion that a few extra indices would speed up the application significantly.
I suggest adding indices to the foreign keys of the tables.
I got a massive performance gain just by adding an index to the project_id column of the events table:
ALTER TABLE events ADD INDEX project_id (project_id)
Hi. Good tip!
Sorry, closed it by accident... Still in favor of additional indices ;)
Can you make a short list of indices you think we should apply?
Event indices related to #2159
@danielkummer i've pushed indices for events
I learned that there should be basically indices for anything that is used in a WHERE clause.
IMHO AR associations would be obvious.
@riyad yes. at least AR associations
More indices for asscociations. related to #2159
I think its enough for now. Feel free to reopen issue if you have more suggestions
Sorry for the late reply. I'm totally in agreement with @riyad AR associations are always good to be covered by indices... So your changes @randx are right...
If a lot of ordering is applied to the timestamp fields then the may also qualify for a simple index...
Add more indexes (see #2159)
I went through all where and order statements and added indexes for them. There was only one problem with keys.key because MySQL/InnoDB doesn't support indexing text columns. :(
Merge branch 'add-sidetiq' into 'master'
Add sidetiq dependency
Add the sidetiq gem to the Gemfile to match EE. See #2159.
See merge request !1734