|
|
|
|
|
by knucklesandwich
3574 days ago
|
|
Ah, bummer, yeah that's a convenient short term fix. It sounds like you all have this handled pretty well though, I think you'll definitely appreciate the move to a more traditional schema. For events data, JSONB support can be nice for infrequently accessed attributes, so its not an all or nothing proposition, but I found I had a lot less headaches after adding more table structure. |
|
We use inheritance (with check constraints) [1] for both time partitioning as well as for custom (aka unstructured) events. Most events have several (100s in our case) common columns. When you see a new custom event with custom fields you want to separate out you can create a subtable and have it inherit from the base event table.
Now querying for those custom events is extremely fast and you can query from the base event type or the subtable directly.
[1]: https://www.postgresql.org/docs/current/static/ddl-partition...