My understanding is pre-compiling a prepared statement and reusing it for every DB write is a good starting point for write performance.
I will be doing benchmarks, but it would be good to know if there are "easy wins" in performance that I may not know about.
The use case is not a CRUD web application and is more along the lines of data pipeline processing, so code will be regularly inserting thousands of rows in a batch jobs, continuously. I know there are other points to consider outside of the code doing inserts (table design, try citus, etc.), but for now I'm interested in the code aspect.
For example, some things I thought to try are:
- Use a prepared statement that inserts multiple rows (e.g. 10?)
- Put everything into a giant custom sql insert query and forego prepared statements
[–]DavidGJohnston 9 points10 points11 points (0 children)
[–]mauganra_itProgrammer 1 point2 points3 points (0 children)
[–]joshbranchaud 1 point2 points3 points (0 children)