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
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.
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.