home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / bit / listserv / sasl / 3467 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.8 KB  |  43 lines

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