Forum OpenACS Q&A: Re: Ran out of database pools (pool2 pool3 pool1)

Posted by Don Baccus on
If at all possible please rewrite your queries to not use a fourth pool. It is much better to do a more complex query joining multiple tables if possible. Note that in pure SQL, outside an application framework, you can't do any nesting of this sort anyway ... nested query loops can in general be rewritten into a single SQL query with post-processing of the rowset in the db_foreach loop.

We don't really want to force everyone to define four pools be default. Nor do we want the installation of a particular package force people to rewrite their init .tcl file.

The main reason, though, as mentioned above in 2003 ... DEEPLY NESTED DB_FOREACH LOOPS WILL NOT SCALE. Joining multiple tables using a column index DOES SCALE.

Can you describe what you're trying to do in this deeply nested query structure in more detail?