As per Hindu legend, once there was an argument between Saraswathi, the consort of Brahma and Lakshmi on superiority. They went to Indra, the king of celestial deities. Indra judged Lakshmi as superior and not satisfied with his argument, Saraswathi went to her husband, Brahma. He also chose Lakshmi to be the superior one. Saraswathi was unhappy with the decision and decided to stay away from Brahma. Brahma did a severe penance praying to Vishnu and did an Aswametha Yagna. Saraswathi was still angry that the yagna, which usually is done along with consorts was done alone by Brahma. She tried to disrupt the penance, but Vishnu interfered with his serpent Adisesha. Saraswathi, on seeing Vishnu in her path, accepted her defeat and subsided in the form of river Vegavathi. As Vishnu interfered the path of the river, it was termed Vegavani, then as Vegannai and gradually corrupted to Vekka. The presiding deity thus got one of his names, Vegasetu. As per historian Nagaswamy, the temple was called Vehha meaning Vishnu leaning as a slanted slope, which gradually became vekka.