1. A method comprising: storing first data that indicates a characteristic, present at a time when a cursor was generated for a previous query, that affects determination of an execution plan of the previous query; receiving a current query; in response to receiving the current query, determining whether the current query is semantically equivalent to the previous query; determining second data that indicates a characteristic, present at a time when the current query is processed, that would affect determination of an execution plan of the current query; in response to determining that the current query is semantically equivalent to a previous query, determining, based on the first data and the second data, whether compiling the current query would produce an execution plan that satisfies certain criteria; and in response to determining that compiling the current query would produce an execution plan that satisfies the certain criteria, executing the current query using the cursor that was previously generated for the previous query.