title: Oracle performance using functions in where clause
body: <p>In a stored procedure (which has a date parameter named 'paramDate' ) I have a query like this one</p>
  
  <pre><code>select id, name
  from customer
  where period_aded = to_char(paramDate,'mm/yyyy')
  </code></pre>
  
  <p>will Oracle convert paramDate to string for each row?</p>
  
  <p>I was sure that Oracle wouldn't but I was told that Oracle will.
  In fact I thought that if the parameter of the function was constraint (not got a fierld nor a calculated value inside the query) the result should be allways the same, and that's why Oracle should perform this conversion only once.
  Then I realized that I've sometimes executed DML sentences in several functions, and perhaps this could cause the resulting value to change, even if it does not change for each row.</p>
  
  <p>This should mean that I should convert such values before I add them to the query.</p>
  
  <p>Anyway, perhaps well 'known functions' (built in) are evaluated once, or even my functions would also be.</p>
  
  <p>Anyway, again...</p>
  
  <p>Will oracle execute that to_char once or will Oracle do it for each row?</p>
  
  <p>Thanks for your answers</p>