title: How to model array of key/value pairs
body: <p>We are using ClickHouse to store internal performance metrics for webpage loads. Each metric contains an array of key/value pairs for custom load times they care about. We'd like to store these in ClickHouse and be able to query the times like any other time value.</p>
  
  <p>For example, when I get a metric, along with all the standard data I may have data that gives me the load time for a bunch of custom stuff, like this:</p>
  
  <pre><code>TimeStamp=1548268715
  CustomEvents="a=10,b=20,c=30"
  </code></pre>
  
  <p>In this case, I want to store the values <code>a=10</code>, <code>b=20</code>, and <code>c=30</code> in such a way that:</p>
  
  <ol>
  <li>It's still tied to the original data (so I can filter by timestamp, any other field, etc.).</li>
  <li>I can aggregate and query specific "custom events." For example, I may want to do a histogram on all <code>a</code> time values between certain dates.</li>
  </ol>
  
  <p>The challenge is that I don't know in advance which custom events exist. I suppose I could white-list these, but the number of them may become very large, and the cardinality of custom events is very high.</p>
  
  <p>I'd appreciate any thoughts on this. I've got a few ideas, but wouldn't mind any thoughts.</p>