Deuteronomy 5:10 Midrash

וְעֹ֤֥שֶׂה חֶ֖֙סֶד֙ לַֽאֲלָפִ֑֔ים לְאֹהֲבַ֖י וּלְשֹׁמְרֵ֥י מצותו [מִצְוֺתָֽי׃] (ס)

and showing mercy unto the thousandth generation of them that love Me and keep My commandments.

Read midrashic interpretation of Deuteronomy 5:10: and classical rabbinic exegesis.