SYSTEM MESSAGE: WELCOME TO THE MANTiS DIRECTORY LISTING. IF IT IS YOUR FIRST VISIT, CHECK OUT THE FAQ BEFORE POSTING.
MEMBERS: 6 | THREADS: 20 | POSTS: 70  ·  NEWEST: BOOT_SECTOR

STOP USING SELECT * — HERE IS THE PROOF

POSTED BY SYSOP ON 10-12-2026 03:18 AM

Rant incoming.

Every beginner tutorial on the planet teaches SELECT *. Then nobody tells you to stop. So the production query on the leaderboard pulls 18 columns from the threads table to use three. EXPLAIN QUERY PLAN shows the same index hit either way, but the bytes shipped off the disk are six times higher.

Bench: 100k row threads table, SELECT * vs SELECT threadId, title, lastpost. Average over 1000 runs:

SELECT * — 28.4ms
SELECT threadId, title, lastpost — 4.1ms

Same index. Same plan. Six fewer columns. The query planner cannot save you from your own column list.

If you are writing a new query today, list the columns. Always.

// POSTS

Painful to read because it is true. I removed four SELECT * from my own dashboard after seeing this. The thread-listing query on this very board was one of them — pulled 18 columns to use 3.
POSTED BY PLAYER1 ON 10-12-2026 07:14 PM
EXPLAIN QUERY PLAN on a SELECT * on threads vs SELECT threadId, title, lastpost: same index hit, but 18 columns read vs 3. On a 100k row table, that is the difference between 4ms and 28ms. Same plan, six times slower. The query planner cannot save you from your own column list.
POSTED BY BOOT_SECTOR ON 10-19-2026 11:55 PM
Will refactor the leaderboard query this week. Currently pulls 12 columns to use 3. Will report back with the bench numbers.
POSTED BY ADMIN ON 10-20-2026 09:05 AM