Singleton SELECT inside cursor loop - Mailing list pgsql-general

From Ron
Subject Singleton SELECT inside cursor loop
Date
Msg-id ee9f6dc7-281d-f2a1-2556-54d36fd96e91@gmail.com
Whole thread Raw
Responses Example code Re: Singleton SELECT inside cursor loop
List pgsql-general
AWS RDS Postgresql 12.11

It runs quickly, no matter what the fetched cursor values are, as long as 
the cursor returns less than 8 rows.  After that, the singleton SELECT's 
performance tanks.

We've got plenty of other procedures which have a similar "Singleton SELECT 
inside a cursor" design (many even query the same table that the problematic 
query does), but only this procedure's singleton SELECT tanks if the cursor 
returns more than 8 rows.

It only runs once a month, so we've only just noticed the problem.

Why would that be?  (We recently updated from 12.10 to 12.11, if that's 
relevant.)

-- 
Angular momentum makes the world go 'round.



pgsql-general by date:

Previous
From: Bryn Llewellyn
Date:
Subject: Re: Limiting the operations that client-side code can perform upon its database backend's artifacts
Next
From: Ron
Date:
Subject: Example code Re: Singleton SELECT inside cursor loop