☆ 15 r/databases ·by Sofia ·2026-11-01 JSONB column or a separate table? 1431 views Product attributes vary by category. A JSONB column is convenient, but I need to filter by a few attributes. Should I normalise those into columns? ⧉ Copy link⚑ Report
☆ 0 N Nate ·2026-11-01#1 Keep JSONB for the long tail and promote only the attributes you filter on into real columns or a generated column with a B-tree index. ⧉ Copy link⚑ Report
☆ 0 R Robin ·2026-11-01#3 Yes, with a GIN index for containment queries. For equality on one key, an expression index on (data->>'color') is usually faster. ⧉ Copy link⚑ Report
3 replies