LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 27 Aug 2010 13:51:43 -0500
Reply-To:     Joe Matise <snoopy369@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Matise <snoopy369@GMAIL.COM>
Subject:      Re: SQL performance
Comments: To: Bin Zhu <bxz01@health.state.ny.us>
In-Reply-To:  <OF576B7DC9.40582DBC-ON8525778C.0065C582-8525778C.00664224@notes.health.state.ny.us>
Content-Type: text/plain; charset=ISO-8859-1

I don't consider 6 minutes to be terribly long with 5 million records, though it depends on a lot of factors (machine, network, etc.)

I do think the IN statement is a bit slower than equals, or possibly a join to a two record table with lab_id only (allows it to do a hash). But maybe one of the SQL gurus can give you better advice.

-Joe

On Fri, Aug 27, 2010 at 1:37 PM, Bin Zhu <bxz01@health.state.ny.us> wrote:

> Hi, > > I am querying a table with 5 millions records and 5 fields using the > following SQL code: > proc sql; > create table test as > select l.id,l.sample_dt > from temp.lab l > where =lab_id in ('8888-8','9999-1') > order by id, sample_dt; > quit; > > It takes very long time to run (6 minutes). Is a way to make it run faster? > Thanks in advance. > > > Frank > IMPORTANT NOTICE: This e-mail and any attachments may contain confidential > or sensitive information which is, or may be, legally privileged or > otherwise protected by law from further disclosure. It is intended only for > the addressee. If you received this in error or from someone who was not > authorized to send it to you, please do not distribute, copy or use it or > any attachments. Please notify the sender immediately by reply e-mail and > delete this from your system. Thank you for your cooperation. >


Back to: Top of message | Previous page | Main SAS-L page