File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,22 @@ class db_cmd_t
6767
6868struct db_cmd_copy_t : public db_cmd_t
6969{
70- enum { Max_buf_size = 10 * 1024 * 1024 , Max_buffers = 10 };
70+ enum {
71+ /* * Size of a single buffer with COPY data for Postgresql.
72+ * This is a trade-off between memory usage and sending large chunks
73+ * to speed up processing. Currently a one-size fits all value.
74+ * Needs more testing and individual values per queue.
75+ */
76+ Max_buf_size = 10 * 1024 * 1024 ,
77+ /* * Maximum length of the queue with COPY data.
78+ * In the usual case, PostgreSQL should be faster processing the
79+ * data than it can be produced and there should only be one element
80+ * in the queue. If PostgreSQL is slower, then the queue will always
81+ * be full and it is better to keep the queue smaller to reduce memory
82+ * usage. Current value is just assumed to be a reasonable trade off.
83+ */
84+ Max_buffers = 10
85+ };
7186 // / Name of the target table for the copy operation
7287 std::shared_ptr<db_target_descr_t > target;
7388 // / Vector with object to delete before copying
You can’t perform that action at this time.
0 commit comments