Hi Mariel, On 9/6/2017 4:38 AM, Mariel Cherkassky
wrote:
That's the problem. There are a lot of things that can affect query performance, but most of them won't affect an open cursor unless isolation is low and the query's source tables are changing due to ongoing operations. Each time the cursor is accessed, the query's source tables are checked for modifications, and if they have been changed, the cursor's query is re-executed ... potentially changing the result set. Not that it matters here, but you didn't show your actual query. Even if you are only fetching 100 rows, the query may be doing a lot of work (joins, sorts, etc.) to identify those rows. If a complicated query is being executed over and over due to ongoing table modifications ... That's why I suggested using a temporary table that you know won't be modified while the cursor is open on it - it's a way of side-stepping isolation issues that are beyond your control. If there really is no contention for the source tables, the only other possibilities are a badly over-loaded (or mis-configured) server, a problem with the storage system (e.g., a bad disk that is causing hiccups rather than outright failures), or some unknown issue with the extension you are using. I'm afraid I'm out of suggestions. George |