A new study has found that certain bacteria were associated with better memory and attention, while others were linked to an increased risk of Alzheimer's disease.