6 Commits

Author SHA1 Message Date
Alexander Kuzmenkov
1b65297ff7 Fix memory leak with INSERT into compressed hypertable
We used to allocate some temporary data in the ExecutorContext.
2022-11-16 13:58:52 +04:00
Alexander Kuzmenkov
39c9921947 Fix flaky copy_memory_usage tests
The changes from e555eea lead to flakiness. They are a leftover of
earlier version and probably not needed anymore.

The original version is also still flaky on Windows, so use linear
regression to tell if the memory usage is increasing.

Verified to still fail on 2.7.x
2022-10-21 21:20:40 +04:00
Jan Nidzwetzki
e555eea9db Fix performance regressions in the copy code
In 8375b9aa536a619a5ac2644e0dae3c25880a4ead, a patch was added to handle
chunks closes during an ongoing copy operation. However, this patch
introduces a performance regression. All MultiInsertBuffers are deleted
after they are flushed. In this PR, the performance regression is fixed.
The most commonly used MultiInsertBuffers survive flushing.

The 51259b31c4c62b87228b059af0bbf28caa143eb3 commit changes the way the
per-tuple context is used. Since this commit, more objects are stored in
this context. The size of the context was used to set the tuple size to
PG < 14. The extra objects in the context lead to wrong (very large)
results and flushes almost after every tuple read.

The cache synchronization introduced in
296601b1d7aba7f23aea3d47c617e2d6df81de3e is reverted. With the current
implementation, `MAX_PARTITION_BUFFERS` survive the flash. If
`timescaledb.max_open_chunks_per_insert` is lower than
`MAX_PARTITION_BUFFERS` , a buffer flush would be performed after each
tuple read.
2022-10-21 09:02:03 +02:00
Alexander Kuzmenkov
8e4dcddad6 Make the copy_memory_usage test less flaky
Increase the failure threshold.
2022-09-08 22:13:18 +03:00
Alexander Kuzmenkov
bc85fb1cf0 Fix the flaky dist_ddl test
Add an option to hide the data node names from error messages.
2022-08-24 15:51:27 +03:00
Alexander Kuzmenkov
51259b31c4 Fix OOM in large INSERTs
Do not allocate various temporary data in PortalContext, such as the
hyperspace point corresponding to the row, or the intermediate data
required for chunk lookup.
2022-08-23 19:40:51 +03:00