← Graph

Do wide models with many columns hurt performance?

question 1 connections

Moderator follow-up on wide models (e.g. User class with 57 columns) combined with many joins for sophisticated pages/reports. Maciej: for background jobs to external services, he's happy to bypass models entirely with a simpler structure; otherwise having many fields isn't typically a big problem. Stephen: his 8-years-ago-self advice — focus on pragmatics and context, don't chase one-size-fits-all solutions. He once extracted a JSON payload column to a polymorphic side table thinking it was smart, saved a millisecond, and regretted it within 3 months. Caio: negotiate with front-end/API clients to load on demand instead; adding a counter-cache column can help in other cases, but 'it depends'.

answer_summary
Usually not a big problem; focus on context and pragmatics. Load on demand, consider counter caches, but don't prematurely split tables.
question Do wide models with many columns hurt performance?
asked_at
Follow-up from moderator on 57-column User models.

Provenance

Created in
Performance Panel at wroclove.rb 2024 2026-04-17 23:20
Read by
1 extraction