Query proof

Count a term on Hacker News by month, sparkline included, with SQL

A Scry query pattern that counts a token on Hacker News month by month and draws the sparkline inside the result set with bar(); the demo term is 'mcp'.

Answer shape

One GROUP BY over hackernews.items returns the monthly count of the token 'mcp' since January 2025, and bar() renders each month as a bar, so the shape of the series is visible in the rows themselves. Measured 2026-09-09 through the public door: 0.76 s, 6,027,149 rows read, 20 rows returned, $0.0030 of machine time, $0 charged.

Sources

  • Hacker News

Methods

  • source-native SQL
  • token-indexed lexical search
  • time series
  • in-query rendering

SQL

Run this through POST /v1/scry/query after inspecting GET /v1/scry/schema for current live fields.

SELECT toStartOfMonth(original_timestamp) AS m, count() AS n,
       bar(n, 0, 2200, 20) AS spark
FROM hackernews.items
WHERE original_timestamp >= '2025-01-01'
  AND original_timestamp < toStartOfMonth(today())
  AND hasToken(search_text_lc, 'mcp')
GROUP BY m ORDER BY m LIMIT 100;

Output, no account

scry.io/s/dikjdnv0 holds this query's rows and its envelope — elapsed, rows read, machine cost — frozen from a run through the public door.

Verification notes

  • NotehasToken(search_text_lc, 'mcp') is a whole-token match over the full-text index: it counts the token, not the sense.
  • NoteThe current month is excluded (original_timestamp < toStartOfMonth(today())), so every bar covers a complete month.
  • NoteRows land every few minutes, so a rerun differs from the frozen output by the day; the difference is freshness, not an error.
  • NoteFrozen output and envelope, no account: https://scry.io/s/dikjdnv0 (2026-09-09: 0.76 s, 6,027,149 rows read, $0.0030 machine cost, $0 charged).

Related sources