GitHub published a repository star-history endpoint on October 14 that returns daily totals instead of a list of people. It addresses a mismatch: chart tools do not need names, and sending fewer fields does not always mean less database work. The engineering lesson is to define the result first, then make the database examine only the records needed for it. GitHub's engineering account describes the design and its reported performance figures.
From people to a trend
Previously, a tool reconstructing a star chart had to page through stargazer records, retain their timestamps, and discard user details. The new REST endpoint returns up to 30 calendar weeks of daily counts per page, with pages moving backward through repository history. A public repository's history can be requested without authentication. The response includes a week timestamp, a weekly total, and seven daily values.
This is data minimization in practice: the caller gets chart data without a roster of people. It removes identities from this response; it does not guarantee aggregate data is anonymous in every context.
Why query order matters
GitHub says one tempting design was to group every star into daily buckets and then paginate those buckets. That reduces the JSON returned, but the database may still do expensive grouping and sorting for the full history on every page. Instead, GitHub says it converts the requested page into an indexed date range, filters matching rows, and only then groups them by day.
In GitHub's example for react/react, the previous pattern would examine roughly six million rows across 24 requests. Its shipped approach examines about 251,000 rows across those requests and cuts history retrieval from roughly 2,511 calls to 24. These are GitHub-reported figures for its system, not an independent benchmark or a promise for another database. The transferable idea is the ordering: narrow rows using an index before aggregation; applying LIMIT after a broad GROUP BY may shrink the response, not the work.
A decision you can use in your own product
Worked example, not a GitHub measurement: suppose an admin dashboard needs two years of weekly activity, not a list of users. Two years is about 104 weeks; at a maximum of 30 weeks per request, the client needs four pages (104 divided by 30, rounded up). Keep daily response data if operators need to spot launch-day changes, but let the chart roll those values up to weeks for the two-year view.
Before implementation, write down the question the screen answers. If it is “did usage rise after release?”, return a bounded range of counts, not user records. Confirm an index supports the range predicate, inspect the query plan, and measure rows scanned as well as response size. Cache stable historical ranges and refresh the current range separately. Set a maximum range and test a dense interval, since an unusually busy week can still make a query expensive.
Read the chart carefully
This is not a complete star/un-star event ledger: GitHub's current stargazer model omits a star after its owner removes it. Documentation says weeks are returned newest first, daily values begin with Sunday, and week/day boundaries are not guaranteed to be UTC. State what the curve represents, avoid silently labeling buckets as UTC days, and reverse pages before assembling a chronological chart.
Image: original AI-generated editorial illustration for AyNcode. It depicts date-range filtering and aggregation, not a GitHub interface or measured result.