title: Inserting zero rows takes 2 minutes
body: <p>I have a long select statement finished with insert, the select returns zero rows in few seconds but insert part takes 1 to 2 minutes....</p>
  <pre><code> with t1 as ()
  
  insert into myscheme.sometable -- if I comment this line it will return zero rows in 3 sec
  
  select t1  
  </code></pre>
  <p>To simplify even more, this code is 3 seconds and result is zero rows:</p>
  <pre><code> with t1 as ()
  
  select t1 
  </code></pre>
  <p>and below is 2 minutes however it is using select statement running 3 sec.(also for zero rows to insert):</p>
  <pre><code> with t1 as ()
  insert into myscheme.sometable
  select t1 
  </code></pre>