7 Commits

Author SHA1 Message Date
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
Sven Klemm
7d310f272e Run postgres JOIN tests on hypertables
This patch adds the postgres join tests and adjusts them to run
on hypertables. We run the tests once with all optimizations
and diff the result with optimization against the result without
optimizations to ensure results do not change with optimizations
enabled.
2019-08-30 21:00:12 +02:00
Joshua Lockerman
4b42b301a7 Free ChunkInsertStates when the es_per_tuple_exprcontext is freed
Instead of freeing ChunkInsertStates immediately when flushed from the
SubspaceStore, defer the freeing until the es_per_tuple_exprcontext is
being cleaned up. This ensures that pointers into the CIS don't become
invalidated without us freeing any of postgres's memory, like we were
doing in the prior fix; this fixes a segfault in COPY.

In the normal INSERT case these frees happen at approximately the same
time so there should be no regression in memory usage, while if there
was a delay in freeing the es_per_tuple_exprcontext our old strategy of
clearing the context ourselves was invalid.
2018-12-14 16:08:40 -05:00
Matvey Arye
e947c6be3a Improve handling of column settings
This PR adds better handling for the following commands:

* ALTER TABLE ... ALTER COLUMN ... SET (attribute_name = value)
* ALTER TABLE ... ALTER COLUMN ... RESET (attribute_name)
* ALTER TABLE ... ALTER COLUMN ... SET STATISTICS
* ALTER TABLE ... ALTER COLUMN ... SET STORAGE

For each of the above commands the associated settings are not properly
propagated to existing chunks and new chunks are created with the
same settings as the hypertable.

We also now allow these commands to be run on chunks.
2018-07-24 14:11:53 -04:00
Erik Nordström
645b530ed2 Convert inserted tuples to the chunk's rowtype
When routing inserted tuples to chunks, the rowtype of the chunk is
expected to match that of the root table. However, this is not always
the case if the root table has been modified, e.g., it had a column
removed. Newly created chunks will in that case have a different
rowtype and therefore tuples need to be converted to the chunk's
rowtype.
2017-08-22 22:01:10 +02:00
Robin Thomas
72f754a576 use PostgreSQL's own hash_any function as default partfunc;
remove all murmur3-related source code. Alter regression tests
to reflect new hash values for inputs, and a slightly different
set of input data to ensure that sufficient chunks and partitions
are tested. Some changes to .sh scripts in sql/setup that seem
to be used only to power the "unit tests", which I cannot
yet run successfully.
2017-04-29 18:31:44 -04:00
Erik Nordström
7b94c573ba Refactor directory structure and tests
- Directory structure now matches common practices
- Regression tests now run with pg_regress via the PGXS infrastructure.
- Unit tests do not integrate well with pg_regress and have to be run
  separately.
- Docker functionality is separate from main Makefile. Run with
  `make -f docker.mk` to build and `make -f docker.mk run` to run
  the database in a container.
2017-01-31 20:14:19 +01:00