BookmarkSubscribeRSS Feed
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.



Blue Blue

Blue Blue
Opal | Level 21

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.  

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



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 5 in conversation