in reply to Eliminating Dynamic SQL Generation with Decision Matrices for Tighter Large Scale Applications

If you use prepare_cached(), you can avoid having to prepare the generated queries more than once or build DBI query objects for them. That's the only expensive part of generating SQL. As for the tuning and task division, I just try to minimize the variations in the generated SQL so that it can be optimized by a DBA once and then left alone. If necessary, you can dump out all the variations once and let your DBA test them all.

If you were to literally put every variation of SQL in your program, you would have a maintenance nightmare with tons of duplication in the SQL code.

  • Comment on Re: Eliminating Dynamic SQL Generation with Decision Matrices for Tighter Large Scale Applications