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

...generating SQL statements beforehand... seems to conflict with the desire of many users to perform ad-hoc queries, even if constrained by a simple web form.

It all depends on the size of the database, the type of queries, and the load that is placed on the database (i.e. the number of parallel instances of such ad-hoc queries).

Personally I've worked on several large systems (for example the now defunct eCircles.com site) where all access to the database is via pre-defined stored procedures (which is equivalent to pre-defined queries, really). Obviously it requires some thought to define the set of operations that users should be allowed to perform, but it has the huge advantage of separating the SQL from the application. If a query performs badly it can be tuned by the DBA (or the SQL developper) without touching the perl code (as long as the input and output stays the same, of course).
The queries can also be analyzed in isolation to ensure decent performance.

It is, IMHO, a must.

Michael

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