BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11

Hello team,

 

Is there any way to do inner join in a way to take less process time?

 

Any syntax is greatly appreciated.

 

Thanks,

Blue Blue

Blue Blue
4 REPLIES 4
SASKiwi
PROC Star

If you are limiting yourself to SQL then there are no inner join syntax variations that guarantee better performance. It all depends on the volume, structure and cardinality of the tables and data you are joining. Incomplete joins will obviously result in slower performance and incorrect results. Understanding the data you are joining is key to writing efficient SQL inner joins.  

LinusH
Tourmaline | Level 20

As others already implied, there is no one size fits all when it comes to query optimization.

Assuming your data is in SAS datasets, some general guidelines though:

- Use equi-joins when possible

- Avoid OR

- Avoid function call in where/on clause

- If join presumably return a relative small result set, using indexes on join variables may help

- Allow your process to use as much memory as possible to minimize the use of swapping to spill files.

- Analyse your query behaviour by using the PROC SQL options _method and _tree, and using the global option FULLSTIMER.

Data never sleeps

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 805 views
  • 2 likes
  • 5 in conversation