A study of more than 833,000 adults found that one trait was associated with a higher risk of dementia.