Forum OpenACS Q&A: Response to There's a problem with education/class/one.tcl

Collapse
Posted by Don Baccus on
It will be even nicer when Ben upgrades to our new release with its beautiful lztext bboard module and the resultant 32KB posts we'll be able to make :)

Dan, did you commit this query to CVS?

Also, you might check out the way I rewrote /intranet/employees/admin/index.tcl and friends.  I was able to get away from the horribly complex set of unions that resulted from mechanical translation.  The result might be a bit slower, using subselects in the select clause of the main query, but I at least find  it a heck of a lot easier to read.  And it might not be slower, I suspect huge unfolded unions might slow down the optimizer as much as the subselects in my rewrite slow down the executor.

My rewrite trick won't apply to all complex outer joins, mechanically unfolded horrors like your example here are still going to be necessary at times.  I haven't systematically gone through intranet yet to see if I can do similar simplifications (I was originally motivated by the fact that a couple of your big unions didn't quite work right, but I suspect most of them do).

In the case of the intranet module, it's all bogus anyway.  If the turkey who wrote it always created an im_employee_info entry when you add an employee it wouldn't be necessary to outer-join to the table in the first place.  Given that org-chart.tcl breaks in ACS Classic until  you manually add "none" as a supervisor for your CEO (as opposed to the "none" created by magic via outer joins), aD doing it right in the first place sounds like it would've been a winner to me...