How do you optimize a slow-running SQL join query involving large-scale patient demographic and clinical tables at Health Care Solutions At Home?