home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!darwin.sura.net!paladin.american.edu!auvm!NIHCU.BITNET!HIS
- Message-ID: <SAS-L%92072913174451@UGA.CC.UGA.EDU>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 29 Jul 1992 13:15:59 EDT
- Reply-To: Howard Schreier <HIS@NIHCU.BITNET>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Howard Schreier <HIS@NIHCU.BITNET>
- Subject: SQL Optimizer
- Lines: 31
-
- CONTENT: Response
- SUMMARY: SQL automatically seeks shortcuts, but user can help
- REL/PLTF: 6.06+
-
- Inquiry from a user of PROC SQL:
-
- > I am using PROC SQL to match up rows of a large dataset, by merging a
- > table with itself. The dataset is primarily defined by IDN (id
- > number). In using SQL, the big table is formed as the Cartesian
- > product of all rows. Since there are 7138 rows, the interim table
- > (before WHERE processing) is large. Can I restrict PROC SQL to form
- > interim tables separately for each value of IDN?
-
- PROC SQL has optimization techniques built in, but users'
- coding and other decisions (such as index creation) can
- affect the process. See pp. 74-78 of the SAS Guide to the
- SQL Procedure, as well as Paul Kent's 1991 and 1992 SUGI
- papers.
-
- Where possible, SQL will avoid constructing all rows of the
- Cartesian product. In this case, if the WHERE clause is a
- simple equality test ("where left.IDN = right.IDN"), I
- believe the optimizer will automatically do what you
- envision, so the query should not take long.
-
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- \ Howard Schreier, U.S. Dept. of Commerce, Washington /
- / MVS 5.18 & 6.07 \
- \ Voice: (202) 377-4180 BITNET: HIS@NIHCU /
- / Fax: (202) 377-4614 INTERNET: HIS@CU.NIH.GOV \
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-