title: Dont aggregate entire column if selecting distinct pk's with order by pk and limit
body: <p>I have a clickhouse table <em>events</em> containing 50M rows for a year period (duplicates possible)</p>
  <pre class="lang-sql prettyprint-override"><code>
      create table events (
          event LowCardinality(String),
          event_time DateTime64(3),
          uid       String
      ) engine=ReplacingMergeTree() toYYYYMM(event_time)
          primary key (event, event_time)
          order by (event, event_time, uid)
  </code></pre>
  <p>When I try to select the first 500 distinct rows clickhouse processes all of them (50M)</p>
  <pre class="lang-sql prettyprint-override"><code>    select distinct event, event_time 
      from events 
      where event='some_event' and event_time between '2020-02-24 00:00:00.000' AND '2021-02-24 00:00:00.000' 
      order by(event, event_time) desc limit 500
  </code></pre>
  <p>So it basically <em>groups by event, event_time</em> 50M rows before applying a limit to them. Is it possible to force clickhouse not to read data for the entire period?</p>