Optimization Questions

1. It appears that building SQL line by line is very inefficient and causes parse/describe calls to the DB. That the best approaches would be to surround the SQL building with BeginUpdate/EndUpdate or do an assignment like
SQL := NewSQL. Is this correct?
No, this does not affect anything.
2. The Optimize property does not appear to be effective unless direct assignment to the SQL property is used. Is this correct?
Not really. When True, the TOracleQuery/DataSet will attempt to reuse the parsed representation of the cursor. This will reduce parse operations, which is only possible if the SQL text and variable data types have not changed between subsequent executes/opens (in other words: only the variable values may change).
3. I understand that using bind variables whenever possible will keep the SQL unchanged and thus eliminate the server having to reparse. However, I
 
Back
Top