Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!ucbvax!ucdavis!csusac!unify!kak From: kak@Unify.Com (Kelly Kingdon) Newsgroups: comp.databases Subject: Re: a question regarding a query using Unify 4.0 SQL Message-ID: Date: 17 Aug 90 14:53:21 GMT References: <201603@hrc.UUCP> Organization: Unify Corporation, Sacramento, CA, USA Lines: 38 In article <201603@hrc.UUCP> dan@hrc.UUCP (Dan Troxel) writes: > >I am using Unify 4.0 with sql on a Convergent Tech. S/640. > >I have 2 tables. > >I wish to find all records in the parent table, >that are *not* found in its child table. > >I believe this is wrong, at least *very* slow, but tell me what I have to do >to fix it. > > select rolodex.entry_num from rolodex > where rolodex.referral_source = 'POST*' > and rolodex.entry_num ^= > select rolnotes.rol_linker from rolnotes > where rolnotes.rol_linker = rolodex.entry_num/ >-- >Dan Troxel @ Handwriting Research Corporation WK 1-602-957-8870 >Camelback Corporate Center 2821 E. Camelback Road Suite 600 Phoenix, AZ 85016 >ncar!noao!asuvax!hrc!dan zardoz!hrc!dan hrc!dan@asuvax.eas.asu.edu I think this will work better for you, it only executes the inner query once where as yours is being executed for every record it finds in the outer query (variable query): select rolodex.entry_num from rolodex where rolodex.referral_source = 'POST*' and not rolodex.entry_num in select rolnotes.rol_linker from rolnotes/ -- Kelly Kingdon internet: kak@unify.UUCP Premium Customer Support ...!{csusac,pyramid}!unify!kak Unify Corporation voice: (916) 922-1177 3870 Rosin Court, Sacramento, CA 95834 fax: (916) 920-5306