title: reducing execution time of this query
body: <p>Can any help me to optimize this query below?</p>
  
  <pre><code>Select id,name 
  from tb_demo t1 
  WHERE id NOT IN 
      (Select id 
       from tb_demo 
       WHERE time &gt; now() 
           AND id = t1.id) 
  group by id
  </code></pre>