title: Filtering results from ClickHouse using values from dictionaries
body: <p>I'm a little unfamiliar with ClickHouse and still study it by trial and error. Got a question about it.</p>
  
  <p>Talking about the star scheme of data representations, with dimensions and facts. Currently, I keep everything in PostgreSQL, but OLAP queries with aggregations start to show bad timing, so I'm going to move some fact tables to ClickHouse. Initial tests of CH show incredible performance, however, in real life the queries should include joins to dimension tables from PostgreSQL. I know I can connect them as dictionaries.</p>
  
  <p>Question: I found that using dictionaries I can make requests similar to LEFT JOINs in good old RDBMS, ie values from resultset could be joined with corresponding values from the dictionary. But can they be filtered by some restrictions on dictionary keys (as in INNER JOIN)? For example, in PostgreSQL I have a table <code>users (id, name, ...)</code> and in ClickHouse I have table <code>visits (user_id, source, medium, session_time, timestamp, ...)</code> with metrics about their visits to the site. Can I make a query to CH to fetch aggregated metrics (number of daily visits for given date range) of users which <code>name</code> matches some condition (<code>LIKE "EVE%"</code> for example)?</p>