performance Questions - RunSubmit.com most recent 30 from http://www.runsubmit.com 2010-07-29T19:54:23Z http://www.runsubmit.com/feeds/tag/performance http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://www.runsubmit.com/questions/264/joining-views-with-indexes-in-proc-sql Joining views with indexes in proc SQL Robert Penridge 2010-05-26T21:51:34Z 2010-05-27T13:56:21Z <p>Hi All</p> <p>I have two views, app, and app_status. Each view simply concatenates monthly datasets like so:</p> <pre><code>create view app as select * from app_200901 outer union corresponding select * from app_200902 outer union corresponding ... select * from app_201004 outer union corresponding select * from app_201005; create view app_status as select * from app_status_200901 outer union corresponding select * from app_status_200902 outer union corresponding ... select * from app_status_201004 outer union corresponding select * from app_status_201005; </code></pre> <p>Each <em>TABLE</em> (ie. app200901 or app_status_200901, etc.) is indexed on app_id. When querying either view the indexes on the tables are used. For example the following is fine:</p> <pre><code>select * from app where app_id = 123 </code></pre> <p>However, if I cannot find a way to make SAS use the indexes when joining the two views together. For example:</p> <pre><code>select a.*, b.status from app a join app_status b on b.app_id eq a.app_id </code></pre> <p>In my mind this should work. In reality it doesn't =). The views contain almost 100 million records each so performance is important. </p> <p>Any suggestions on how I can join these tables faster!?</p> <p>Thanks Rob</p> http://www.runsubmit.com/questions/33/is-a-hash-object-faster-than-an-array Is a Hash object faster than an Array? Moderator 2009-10-21T01:51:23Z 2010-01-09T23:36:36Z <p>Could anyone explain why an array will always be faster than a hash object described in SAS Prog3 course note?</p>