Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!dogie.macc.wisc.edu!uwvax!mycella.cs.wisc.edu!lieuwen From: lieuwen@mycella.cs.wisc.edu (Dan Lieuwen) Newsgroups: comp.databases Subject: Re: I'm looking for embedded database/4gl/persistent PL code Message-ID: <11732@spool.cs.wisc.edu> Date: 15 Nov 90 18:50:48 GMT References: <1990Oct25.081639.14155@abblund.se> <1990Nov1.144502.18208@pds3> <1990Nov5.191125.3008@wdl1.wdl.fac.com> <11687@spool.cs.wisc.edu> Sender: news@spool.cs.wisc.edu Organization: U of Wisconsin CS Dept Lines: 45 lieuwen> I'm working on optimizing such code as part of my current lieuwen> research, [ ... ] Do you have any embedded SQL (or some other lieuwen> embedded query language) with "master-detail" layout? lieuwen> Basically, I'm looking for code with the following form: lieuwen> loop while cursor1 not empty { lieuwen> ... lieuwen> loop while cursor2 not empty { lieuwen> ... lieuwen> } lieuwen> ... lieuwen> } >>I hope nobody would ever code such a loop (silly me :->), because it is >>the N-squared (if the two underlying relations are not suitably sorted) >>implementation of a join of some kind. Such things are best left to the >>DBMS implementor. It looks pretty much a waste to have a wonderful query >>planner in the DBMS engine and then bypass it... ==> People write this code for several reasons. 1) They were brought up doing database programming in another environment, and never learned how to deal with another environment. 2) Some of the ... code has integrity constraint checking. I never would have believed it before starting to look over embedded COBOL, but was told by a data processing person that the supplied integrity checking is a) Too expensive and b) Too restrictive (they want exceptions) 3) People want a selection criterion on cursor1 that the database won't supply. 4) The inner cursor is hidden in a function/procedure call. I promise not to tell anyone about your coding style if you provide any code. I'll only mention that I've seen such code. Dan -- --Dan