When ever queryoptimization is needed, what I would do is see how each query works, which part of query is running slow and try to find why it i running slow and how can I enhance query performance. With proper techniques, lot of queries can be optimized. Say building indexes can help, a hash join could be better or a join by format. There could be many more techniques
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.