I store statistics data in MySQL and want to migrate it to the Clickhouse.
For one entity I have multiple statistics types. For examples: clicks
, views
, upvotes
And now I store it in the table which looks like: entity_id | datetime | type | value
, where type
is a constant integer which corresponds to one of statistics types described above.
Is it better to keep the same structure in Clickhouse or to create the next schema: entity_id | datetime | clicks | views | upvotes
As I understood, the Clickhouse is column-oriented DB. Does it mean that the Clickhouse has zero-cost altering when we want to add new columns, when it will be necessary?