TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Poor count() performance with MySQL compared to PostgreSQL with JSON datasets

2 pointsby velmualmost 5 years ago

2 comments

gregjoralmost 5 years ago
Did you try SELECT COUNT(*) FROM trip ?<p>MySQL has optimizations for that, and since you’re counting the primary key column, which can’t contain NULL values, the result will be the same.<p>You might want to move the JSON column to a separate table with a 1:1 relationship (same primary key) to keep the row size down in the main table.
mister_hnalmost 5 years ago
What are the advantages of using JSON instead of Blob in the DB and convert the blob in JSON in code?