Replies: 3 comments 1 reply
-
You seem to be right, using cursor performs better in this case. The question is how to use cursors effectively with Django. It uses them with |
Beta Was this translation helpful? Give feedback.
-
Thanks! |
Beta Was this translation helpful? Give feedback.
-
This has been really beneficial for our server. Since this has been applied the disk access (and so the loadavg) are way lower! Thanks again! |
Beta Was this translation helpful? Give feedback.
-
We are experiencing performance issues, bottleneck is at disk level caused by postgres SELECT queries.
For instance the following query can take 30s-2min
The same query using CURSOR takes few ms:
Have you already considered using CURSOR instead of LIMIT? I am no postgres at all but got help from a postgres sysop, they told me that CURSOR would be more effective in this use case.
https://www.postgresql.org/docs/current/plpgsql-cursors.html
Beta Was this translation helpful? Give feedback.
All reactions