–Don’t allow the code generator to create SQL for you without first testing it for efficiency.
–Test the SQL that is generated and, if necessary, modify the generated SQL or build indexes to optimize the generated SQL before moving the program to a production environment.
–DBA should be responsible for implementing a procedure to ensure that such SQL performance testing occurs.