4685 Commits

Author SHA1 Message Date
Sven Klemm
50c757c6f1 Adjust .gitignore for transparent_decompression test files 2024-01-29 12:57:43 +01:00
Sven Klemm
83ff9662dc Verify compression configuration on compression rollup
Add a check to verify compression settings for chunks to be rolled
up are identical.
2024-01-25 16:43:47 +01:00
Sven Klemm
4934941f75 Remove restrictions for changing compression settings
This patch removes the restrictions preventing changing compression
settings when compressed chunks exist. Compression settings can now
be changed at any time and will not affect existing compressed chunks
but any subsequent compress_chunk will apply the changed settings.
A decompress_chunk/compress_chunk cycle will also compress the chunk
with the new settings.
2024-01-25 16:13:15 +01:00
Nikhil Sontakke
c715d96aa4 Don't dump unnecessary extension tables
Logging and caching related tables from the timescaledb extension
should not be dumped using pg_dump. Our scripts specify a few such
unwanted tables. Apart from being unnecessary, the "job_errors" had
some restricted permissions causing additional problems in pg_dump.

We now don't include such tables for dumping.

Fixes #5449
2024-01-25 12:01:11 +05:30
Konstantina Skovola
929ad41fa7 Fix now() plantime constification with BETWEEN
Previously when using BETWEEN ... AND additional constraints in a
WHERE clause, the BETWEEN was not handled correctly because it was
wrapped in a BoolExpr node, which prevented plantime exclusion.
The flattening of such expressions happens in `eval_const_expressions`
which gets called after our constify_now code.
This commit fixes the handling of this case to allow chunk exclusion to
take place at planning time.
Also, makes sure we use our mock timestamp in all places in tests.
Previously we were using a mix of current_timestamp_mock and now(),
which was returning unexpected/incorrect results.
2024-01-24 18:25:39 +02:00
Alexander Kuzmenkov
92e9009960 Vectorize more arithmetic functions
We didn't account for some permutations of types like comparing int4 to
int2.
2024-01-24 14:22:37 +01:00
Konstantina Skovola
942f1fb399 Fix OSM build failure
The commit #6513 removed some restricted chunk operations, enabling
adding constraints to OSM chunks directly. This operation is blocked
on OSM chunks. The present commit ensures that adding a constraint
directly on an OSM chunk is blocked.
2024-01-23 17:07:47 +02:00
Ante Kresic
80f1b23738 Reduce index lock in segmentwise recompression
Segmentwise recompression grabbed an AccessExclusiveLock on
the compressed chunk index. This would block all read operations
on the chunk which involved said index. Reducing the lock to
ExclusiveLock would allow reads, removing blocks from other
ongoing operations.
2024-01-23 15:08:57 +01:00
Sven Klemm
0b23bab466 Include _timescaledb_catalog.metadata in dumps
This patch changes the dump configuration for
_timescaledb_catalog.metadata to include all entries. To allow loading
logical dumps with this configuration an insert trigger is added that
turns uniqueness conflicts into updates to not block the restore.
2024-01-23 12:53:48 +01:00
Jan Nidzwetzki
4cb7bacd17 Change GitHub token for changelog check
Since #6505, the changelog script tries to access the
secrets.ORG_AUTOMATION_TOKEN. However, accessing secrets is not possible
for PRs. This PR changes the token to the default access token, which
is available in PRs and provides read access to the issue API.
2024-01-23 11:15:52 +01:00
Alexander Kuzmenkov
d7018953c1 Fix joins with compressed chunks
We couldn't use parameterized index scan by segmentby column on
compressed chunk, effectively making joins on segmentby unusable. We
missed this when bulk-updating test references for PG16. The underlying
reason is the incorrect creation of equivalence members for segmentby
columns of compressed chunk tables. This commit fixes it.
2024-01-23 10:18:05 +01:00
Sven Klemm
acd69d4cd2 Support all time_bucket variants in plan time chunk exclusion
Since the optional time_bucket arguments like offset, origin and
timezone shift the output by at most bucket width we can optimize
these similar to how we optimize the other time_bucket constraints.

Fixes #4825
2024-01-22 16:23:23 +01:00
Fabrízio de Royes Mello
a44a19b095 Remove some multinode leftovers from CAggs 2024-01-22 12:14:17 -03:00
Matvey Arye
e89bc24af2 Add functions for determining compression defaults
Add functions to help determine defaults for segment_by and order_by.
2024-01-22 08:10:23 -05:00
Konstantina Skovola
2ab2a4fbb5 List failed tests on PG16 CI 2024-01-22 14:28:38 +02:00
Konstantina Skovola
77981ba30b Fix OSX build failure
Use Python 3.12 instead of 3.11 to avoid brew link error
with dependencies.
2024-01-22 13:35:20 +02:00
Mats Kindahl
b7d0c14e32 Send message to security channel on segfault label
If an issue is labeled with either `segfault` or `security`, send a
message to the security channel that the issue needs attention.
2024-01-22 11:34:29 +01:00
Sven Klemm
754f77e083 Remove chunks_in function
This function was used to propagate chunk exclusion decisions from
an access node to data nodes and is no longer needed with the removal
of multinode.
2024-01-22 09:18:26 +01:00
Sven Klemm
9722eabb38 Refactor compression settings processing 2024-01-20 17:24:16 +01:00
Alexander Kuzmenkov
2174a7188d Allow mentioning fixed issues in the changelog
Also allow mentioning the PR like now. The numbers of issues must match
the issues referenced by the PR.
2024-01-19 19:39:13 +01:00
Alexander Kuzmenkov
de93e3916a Use parameterized time_bucket for chunk exclusion
When time_bucket is compared to constant in WHERE, we also add condition
on the underlying time variable (ts_transform_time_bucket_comparison).
Unfortunately we only do this for plan-time constants, which prevents
chunk exclusion when the interval is given by a query parameter, and a
generic plan is used. This commit also tries to apply this optimization
after applying the execution-time constants.

This PR also enables startup exclusion based on parameterized filters.
2024-01-19 19:39:13 +01:00
Alexander Kuzmenkov
02846e326a Improve memory locality in batch sorted merge
In the binary heap, address smaller dedicated structures with data
necessary for comparison, instead of the entire CompressedBatch
structures. This is important when we have a large number of batches.
2024-01-19 17:50:48 +01:00
Sven Klemm
20804275ee Remove outdated checks from update scripts
This patch removes some version checks that are now superfluous.
The oldest version our update process needs to be able to handle is
2.1.0 as previous versions will not work with currently supported
postgres versions.
2024-01-19 17:47:26 +01:00
Sven Klemm
0a9285075e Remove reference to PG12 in cmake file 2024-01-19 16:50:48 +01:00
Sven Klemm
d5fa21de0a Add isolation test for parallel compression
The changes for per chunk compression settings got rid of some
locking that previously prevented compressing different chunks
of the same hypertable. This patch just adds an isolation test for
that functionality.
2024-01-17 20:40:20 +01:00
Sven Klemm
f57d584dd2 Make compression settings per chunk
This patch implements changes to the compressed hypertable to allow per
chunk configuration. To enable this the compressed hypertable can no
longer be in an inheritance tree as the schema of the compressed chunk
is determined by the compression settings. While this patch implements
all the underlying infrastructure changes, the restrictions for changing
compression settings remain intact and will be lifted in a followup patch.
2024-01-17 12:53:07 +01:00
Konstantina Skovola
55ae29cf16 Fix if_not_exists behavior for CAgg policy with NULL offsets
Fixes #5688
2024-01-17 11:38:08 +02:00
Nikhil Sontakke
15c14bd339 Enable debug info about compression scan paths
We enabled scans using indexes for a chunk that is to be compressed.
The theory was that avoding tuplesort will be a win if there's a
matching index to the compression settings. However, a few customers
have reported very slow compress timings with lots of disk usage. It's
important to know which scan is being used for the compression in such
cases to help debug the issue. There's an existing GUC parameter which
was "DEBUG" only till now. Make it available in release builds as well.
2024-01-17 12:57:32 +05:30
Ante Kresic
45bc8a01c5 Remove reindex_relation from recompression
We used to reindex relation when compressing chunks. Recently
we moved to inserting into indexes on compressed chunks in
order to reduce locks necessary for the operation. Since
recompression uses RowCompressor, it also started inserting
tuples into indexes but we never removed the relation reindexing.
This change removes the unnecessary reindex call.
2024-01-16 13:27:15 +01:00
Nikhil Sontakke
7ae7cc5713 Disallow triggers on CAggs
We don't support triggers on CAggs yet. Disallow that explicitly
till we support them later.

Fixes #6500
2024-01-15 19:01:55 +05:30
Alexander Kuzmenkov
095504938d Re-enable clang-tidy in CI
Also fix the accumulated problems.
2024-01-15 13:57:36 +01:00
Sven Klemm
d16bc17fe6 Remove grep based update script check
Remove the grep based update script check and add some additional
checks to the AST based one.
2024-01-15 13:33:05 +01:00
Ante Kresic
f08e9f02cb Reduce transparent_decompress_chunk test flakiness
One of the merge join queries is known to switch inner and
outer join relations because the costs seem to be the same.
Adding an additional filter on one of the relations should
change the costs enough so they are not interchangeable.
2024-01-12 14:53:22 +01:00
Alexander Kuzmenkov
67c37010f2 Add apt update to libfuzzer workflow 2024-01-12 12:39:52 +01:00
Sven Klemm
75cc4f7d7b Improve multinode detection in update script
Previously we would only check for data nodes defined or distributed
hypertables being present which might not be true on data nodes so
we prevent update on any installation that has dist_uuid defined which
is also true on data nodes.
2024-01-12 11:18:35 +01:00
Alexander Kuzmenkov
f08dd10425 Check the spelling in our code with codespell 2024-01-11 12:18:50 +01:00
Alexander Kuzmenkov
4e7edf370a Don't analyze the uncompressed chunk before compressing it
We don't use the statistics on the uncompressed chunk anyway. This
significantly improves the compression performance.
2024-01-11 12:17:58 +01:00
Alexander Kuzmenkov
1cd77b3a24 Vectorize filters with external parameters
For example, comparison to a query parameter in a parameterized prepared
query.
2024-01-11 12:08:54 +01:00
Mats Kindahl
662fcc1b1b Make extension state available through function
The extension state is not easily accessible in release builds, which
makes debugging issue with the loader very difficult. This commit
introduces a new schema `_timescaledb_debug` and makes the function
`ts_extension_get_state` available also in release builds as
`_timescaledb_debug.extension_state`.

See #1682
2024-01-11 10:52:35 +01:00
Mats Kindahl
e80728cdb3 Log extension state changes
To debug issues with extension state not being correct we log extension
state changes on `DEBUG1` level.

See #1682
2024-01-11 09:43:07 +01:00
Alexander Kuzmenkov
9c75b0329e Don't add unneded null test in sorted query plan for minmax
If we use NULLS LAST, we don't need the null test. This saves some CPU.
2024-01-10 15:56:00 +01:00
Ante Kresic
d9408311c6 Handle DST changes in gapfill
This change makes gapfill calculate timezone offsets like
we do in time_bucket when there is a supplied timezone.
Without this, timezones would not align and we get timestamp
mismatches which cause double entries for a single bucket.
2024-01-10 13:23:43 +01:00
Sven Klemm
5676ace4c1 Add helper function to get all chunks of a hypertable
This patch adds a function `ts_chunk_get_by_hypertable_id` to return
a List of all chunks belonging to a hypertable. The returned chunk
objects will not have any constraints or dimension information filled
in.
2024-01-09 19:50:20 +01:00
Jan Nidzwetzki
df7a8fed6f Post-release fixes for 2.13.1
Bumping the previous version and adding tests for 2.13.1
2024-01-09 16:31:07 +01:00
Alexander Kuzmenkov
202ac8d3a0 Vectorize NullTest
This applies for checks like `variable IS (NOT) NULL`.
2024-01-09 16:16:50 +01:00
Jan Nidzwetzki
58859cb319 Disable changelog check for backports
So far, we have also checked the changelog files on our backport branch.
However, the test always failed since the backported PR numbers did not
match the changelog PR numbers. This PR disables the changelog check on
the backport branch.
2024-01-09 13:52:51 +01:00
Sven Klemm
8bdc053925 Remove references to compressed hypertable internals from tests
Adjust tests to not access columns in the compressed hypertable.
While this is currently possible a followup patch will remove this
functionality.
2024-01-09 12:38:18 +01:00
Jan Nidzwetzki
3fef7a9579 Fix OS X build
The OS X build currently fails with a brew link error for Python. This
PR fixes the problem by allowing the overwriting of existing files in
the Python install step.
2024-01-09 10:21:36 +01:00
Jan Nidzwetzki
58298e9307 Automatically trigger package builds on release
This patch adds a workflow to trigger package creation after a release
is created on GitHub.
2024-01-05 09:12:14 +01:00
Sven Klemm
b819aa24c0 Refactor compression settings handling
This patch moves the check function for orderby and segmentby into
dedicated functions and cleans up a few other places where code was
redundant.
2024-01-04 16:53:48 +01:00