How would you go about this?

Aahz Maruch aahz at panix.com
Thu Oct 19 14:57:46 EDT 2000


In article <1cfuus4j0sno8e0l63gg8ggqhoh20g9hch at 4ax.com>,
Dale Strickland-Clark  <dale at out-think.NOSPAM.co.uk> wrote:
>
>SQL queries are generated on the fly based upon the users' selection
>criteria. There are over thirty tables involved and the JOINs can get
>pretty long. Although it works, the code for this isn't as tidy as I
>would have liked and I'm convinced there is a much better approach.
>
>I'm interested in hearing from anyone who has developed SQL-based
>database applications in Python (or other OO language) which generate
>dynamic queries. (Or who reckons they know about such things!)

One thing that can help a lot is using stored procedures.  Views are
also good for reducing complexity; how much they improve performance
depends a lot on the system.  Finally, for a reporting system,
denormalized tables generated from the base system (particularly if
real-time performance isn't essential) can work really well.

(I'm sure there's other advice available, but this is what I've got.)
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"real love can't be explained by simplistic platitudes."  --piranha



More information about the Python-list mailing list