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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-11-23 16:14:04 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-11-23 16:17:07 +0300
commit5371da341e9d7768ebab8e159b3e2cc8fad1d827 (patch)
tree0de89ef24150fb103846ea5a89ef07b3969fe655 /app/models/note.rb
parentd7eeb6df51ffe2ad864ef49d0e465b88ab158520 (diff)
Remove event caching code
Flushing the events cache worked by updating a recent number of rows in the "events" table. This has the result that on PostgreSQL a lot of dead tuples are produced on a regular basis. This in turn means that PostgreSQL will spend considerable amounts of time vacuuming this table. This in turn can lead to an increase of database load. For GitLab.com we measured the impact of not using events caching and found no measurable increase in response timings. Meanwhile not flushing the events cache lead to the "events" table having no more dead tuples as now rows are only inserted into this table. As a result of this we are hereby removing events caching as it does not appear to help and only increases database load. For more information see the following comment: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb13
1 files changed, 0 insertions, 13 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 9ff5e308ed2..9881506edc8 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -198,19 +198,6 @@ class Note < ActiveRecord::Base
super(noteable_type.to_s.classify.constantize.base_class.to_s)
end
- # Reset notes events cache
- #
- # Since we do cache @event we need to reset cache in special cases:
- # * when a note is updated
- # * when a note is removed
- # Events cache stored like events/23-20130109142513.
- # The cache key includes updated_at timestamp.
- # Thus it will automatically generate a new fragment
- # when the event is updated because the key changes.
- def reset_events_cache
- Event.reset_event_cache_for(self)
- end
-
def editable?
!system?
end