TwKit
正在载入
TwKit

I raced SQLite and DuckDB on the same 1M-row analytics query. Back to back. Sa… · @ReignSwords · TwKit

@ReignSwords

I raced SQLite and DuckDB on the same 1M-row analytics query. Back to back. Same CSV, same machine, best of 3. 1. GROUP BY region, SUM(amount): 0.483s vs 0.004s → 122x 2. Filter + aggregate over 500 products: 0.212s vs 0.005s → 41x 3. COUNT(DISTINCT product): 0.370s vs 0.002s → 167x 4. Same table on disk: 35.4MB vs 5.3MB Same SQL. Same data. One is a row store built for your phone. The other is a columnar engine built for exactly this question. Honest caveats: SQLite still wins where it wins — embedded, concurrent writers, zero setup, decades of never corrupting your data. I would not put DuckDB in a mobile app. But for every analytics sidecar — the events dump, the log table, the "let me just GROUP BY this CSV" moment — I've been reaching for SQLite out of habit. Habit is costing me 100x. My rule now: if the query has GROUP BY, it's DuckDB. Everything else, SQLite. pip install duckdb. Same SQL you already know. No server, one file. If you benchmark before you argue, we should be following each other. Be honest: are you still on SQLite for analytics because it's actually fine — or just because you never tried the alternative? 🔵 Fellow Premium members, let's connect! I post about AI & tech — follow for more 👥

曝光 79 · 评论 5 · 点赞 1 · 书签 0

查看原帖