I did something like that going from Sao Paulo (Brazil) to Leticia (Colombia) following the coast toward north and later taking amazon river cargo ships. It took me about 5 months, transit days about 2 months.
For example I spend only about 20% of what I make (after taxes). It's not that difficult for IT guys and remote world we live in right now.
You are counting all stars of all repos, they are counting stars of one (parameterized) repo id.
Where r.id = :repo
and you will have the same thing.
Here is some proper SQL query:
SELECT DISTINCT
r.id,
r.owner_id,
r.name,
COUNT(r.id) OVER (PARTITION BY r.id) AS COUNT
FROM repository r
JOIN star s ON s.repository_id = r.id
ORDER BY 4 DESC;Dead Comment