title: Join to 1 row table takes too much time
body: <p>I am trying to read all product codes (mal_no columns) and quantity data (adet columns) from a table ( which is "hso" table and indexed by mal_no, all the tables below have indexes for mal_no) but even if it has only 1 row of data it keeps running and never ends.</p>
  
  <p>Query without this join (by adding only commented out part below) is immediate. </p>
  
  <p>Do you have any suggestion for this ?</p>
  
  <p>Thanks, </p>
  
  <pre><code>select mt.mal_no,hso.adet siparis,
    mot.birim_no,round((mbs.eldeki_stok_miktar*0.8),0) duzelts,
    mot.oncelik,
    SUM(round((mbs.eldeki_stok_miktar*0.8),0)) OVER(ORDER BY 
      mot.oncelik desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) kumule_stok
  from mal_birim_ambar_detay@live mbs
    ,mal_tanim@live mt
    ,mss_temin_yeri_oncelik@live mot
    ,web_hso hso
  where 1=1
  and hso.mal_no=mbs.mal_no
  and mbs.mal_no=mt.mal_no
  and mbs.birim_no=mot.birim_no
  and mt.mal_grup_no=mot.mal_grup_no
  and mt.mal_altgrup_no=mot.mal_altgrup_no
  --and mt.mal_no in ('1035541001') 
  and mbs.eldeki_stok_miktar&gt;0
  and mot.oncelik&gt;0
  and mbs.ambar_no='01'
  order by mot.oncelik desc
  </code></pre>