On Wed, Mar 12, 2025 at 7:57 AM Andy Fan <[email protected]> wrote: > Do you know why we can't use parallel plan when cursor is used? Is It > related to this code in ExecutePlan?
Yes. When a cursor is used, the whole query isn't executed all at once, but rather the executor will be started and stopped for each fetch from the cursor. We can't keep the parallel workers running for that whole time, not just because it would be inefficient, but because it would be incorrect. State changes would be possible in the leader that were not reflected in the workers, leading to chaos. -- Robert Haas EDB: http://www.enterprisedb.com
