The Targum to Esther, 2:5Targum to Esther 2:5 says that Mordechai was descended from Shimei ben Geira, as was Esther, and that David's attitude toward Shimei initially was due to his prophetic knowledge of the two saviors of Israel that were to come from him. Once David saw that Shimei had stopped having children, he knew that Mordechai and Esther were accounted for, so he had Solomon kill Shimei.