Commit graph

6 commits

Author SHA1 Message Date
Yorick Peterse
b7abba0ca0 Revamp trending projects query
This changes the query to use a COUNT nested in an INNER JOIN, instead
of a COUNT plus a GROUP BY. There are two reasons for this:

1. Using a COUNT in an INNER JOIN can be quite a bit faster.
2. The use of a GROUP BY means that method calls such as "any?"
   (and everything else that calls "count") operate on a Hash that
   counts the amount of notes on a per project basis, instead of just
   counting the total amount of projects.

The query has been moved into Project.trending as its logic is simple
enough. As a result of this testing the TrendingProjectsFinder class
simply involves testing if the right methods are called, removing the
need for setting up database records.
2015-10-06 17:26:32 +02:00
Yorick Peterse
d15eec6460 Use >= instead of > in TrendingProjectsFinder
By using >= we can ensure we actually get all comments of the past
month, instead of the comments of the past month minus the first day in
the range.
2015-10-06 17:26:32 +02:00
Dmitriy Zaporozhets
b6de7ad49e
Fix 500 on trending projects if isntance has 100k+ projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-18 10:45:42 +02:00
Dmitriy Zaporozhets
c27c813311
Improve trending projects finder
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-26 22:43:04 +02:00
Dmitriy Zaporozhets
3c2139ed17 Fix trending projects ordering 2015-02-18 22:23:24 -08:00
Dmitriy Zaporozhets
1df0345e9e
Explore area
Create one place for exploring GitLab instance projects and groups for
both signed in and anonymous users

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-23 11:13:33 +03:00