Request a demo

Public dataset · Web, code and analytics

Hacker News in BigQuery

The hacker_news dataset has every Hacker News story and comment since the site launched in 2006, in one 18.6 GiB table updated daily. The table is not partitioned, so a date filter saves nothing: cost depends on columns, and comment text is by far the heaviest.

bigquery-public-data.hacker_news · Hacker News (Y Combinator) · US · Sizes measured November 23, 2026

1tables
18.6 GiBlogical size
50,548,989rows
$0.11to scan every column once, on-demand

bigquery-public-data.hacker_news contains all stories and comments from Hacker News since its launch in 2006, according to the dataset description. Everything is in one table, full, which its description calls a full daily update of all stories and comments; it was last modified on the day these sizes were measured.

Each row is one item. type tells stories from comments, by is the author, score the points a story received, timestamp when it was posted (time holds the same moment as Unix seconds), and parent links a comment to the story or comment it replies to. Stories carry title and url; comments carry text as HTML. descendants is the comment count of a story, and dead and deleted flag removed items.

Tables and sizes

TableRowsSizeFull scanLayout
full
All stories and comments, one row per item, updated daily.
50,548,98918.6 GiB$0.11None

Full scan = every column of the table at the on-demand list price of $6.25 per TiB, before your free TiB each month. Selecting fewer columns costs proportionally less. See BigQuery pricing.

Example queries

Highest-scoring stories of all time

Scans 1.8 GiB · $0.01 on-demand

SELECT id, title, url, score, timestamp
FROM `bigquery-public-data.hacker_news.full`
WHERE type = 'story'
ORDER BY score DESC
LIMIT 20;

Most submitted domains

Scans 841 MiB · under $0.01 on-demand

NET.REG_DOMAIN reduces a host to its registered domain, so www.example.com and blog.example.com both count as example.com.

SELECT
  NET.REG_DOMAIN(url) AS domain,
  COUNT(*) AS stories,
  SUM(score) AS total_score
FROM `bigquery-public-data.hacker_news.full`
WHERE type = 'story'
  AND url IS NOT NULL
GROUP BY domain
ORDER BY stories DESC
LIMIT 20;

Comments that mention BigQuery, per year (expensive)

Scans 16.3 GiB · $0.10 on-demand

Searching comment text reads the largest column in the table, almost all of its 18.6 GiB.

SELECT
  EXTRACT(YEAR FROM timestamp) AS year,
  COUNT(*) AS comments
FROM `bigquery-public-data.hacker_news.full`
WHERE type = 'comment'
  AND LOWER(text) LIKE '%bigquery%'
GROUP BY year
ORDER BY year;

Stories that mention BigQuery in the title, per year

Scans 1.1 GiB · under $0.01 on-demand

The cheaper version of the same question: titles are short, so the scan drops to about 1.1 GiB.

SELECT
  EXTRACT(YEAR FROM timestamp) AS year,
  COUNT(*) AS stories
FROM `bigquery-public-data.hacker_news.full`
WHERE type = 'story'
  AND LOWER(title) LIKE '%bigquery%'
GROUP BY year
ORDER BY year;

Most active commenters since 2025

Scans 1.3 GiB · under $0.01 on-demand

by is a reserved word in GoogleSQL, so it needs backticks. The date filter returns only recent rows but reads the timestamp column for every year, because the table has no partitioning.

SELECT `by` AS author, COUNT(*) AS comments
FROM `bigquery-public-data.hacker_news.full`
WHERE type = 'comment'
  AND timestamp >= '2025-01-01'
GROUP BY author
ORDER BY comments DESC
LIMIT 20;

Querying it cheaply

  • The text column (comment bodies) is most of the table. Avoid SELECT * and searches on text unless you need them; title and metadata queries read 1 to 2 GiB.
  • full is not partitioned or clustered. WHERE timestamp >= ... does not reduce bytes, only the column list does.
  • If you analyze recent activity often, copy it once into your own table with PARTITION BY DATE(timestamp) (see PARTITION BY) and query that copy with date filters.
  • The table is rewritten daily, so query results are cached only until the next update.

FAQ

How much does it cost to query Hacker News in BigQuery?

Story-level queries on titles, scores and URLs read about 1 to 2 GiB. Searching comment text reads about 16 GiB. The whole table is 18.6 GiB, about $0.11 at the $6.25 per TiB on-demand list price, and well inside the free 1 TiB a month.

Is the Hacker News dataset free?

Yes for storage: the table sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).

How current is the Hacker News data in BigQuery?

The full table is described as a full daily update, and its last-modified time was the day these sizes were measured. Expect items from the last day to be missing until the next refresh.

Why doesn't my date filter reduce bytes on hacker_news.full?

The table is not partitioned, so BigQuery reads the referenced columns for every row before filtering. Only selecting fewer columns, or querying your own partitioned copy, lowers the cost.

All public datasets · BigQuery cost queries · Pricing calculator

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.