Re: Improve explicit cursor handling in pg_stat_statements

2025-04-30 Thread Michael Paquier
On Wed, Apr 30, 2025 at 02:43:41PM -0500, Sami Imseih wrote: > I also want to add that the decision to not normalize the cursor name in > the FETCH command is because it would not make sense to combine > FETCH commands for various cursors into the same entry. - calls | rows |

Improve explicit cursor handling in pg_stat_statements

2025-04-30 Thread Sami Imseih
Hi hackers, I recently looked into a workload that makes heavy use of explicit cursors, and I found that pg_stat_statements can become a bottleneck. The application in question declares hundreds of cursors, and for each one, performs many FETCH and MOVE operations with varying fetch sizes. As a r

Re: Improve explicit cursor handling in pg_stat_statements

2025-04-30 Thread Sami Imseih
I forgot to add the proper tests to the Normalize cursor utility statements. Reattaching v2. I also want to add that the decision to not normalize the cursor name in the FETCH command is because it would not make sense to combine FETCH commands for various cursors into the same entry. Regards, -