Path: utzoo!attcan!uunet!mcsun!ukc!dcl-cs!aber-cs!athene!pcg From: pcg@cs.aber.ac.uk (Piercarlo Grandi) Newsgroups: comp.databases Subject: Re: I'm looking for embedded database/4gl/persistent PL code Message-ID: Date: 11 Nov 90 17:02:09 GMT References: <1990Oct25.081639.14155@abblund.se> <1990Nov1.144502.18208@pds3> <1990Nov5.191125.3008@wdl1.wdl.fac.com> <11687@spool.cs.wisc.edu> Sender: pcg@aber-cs.UUCP Organization: Coleg Prifysgol Cymru Lines: 27 Nntp-Posting-Host: odin In-reply-to: lieuwen@mycella.cs.wisc.edu's message of 9 Nov 90 14:31:24 GMT On 9 Nov 90 14:31:24 GMT, lieuwen@mycella.cs.wisc.edu (Dan Lieuwen) said: 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... Note that you might instead be trying to do a closure of some relationship, but that is not done like above. -- Piercarlo Grandi | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcsun!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk