Query-Independent Compilation of Linear Recursions