5325 Commits

Author SHA1 Message Date
Sven Klemm
c51f5e2fe6 Release 2.18.2
This release contains performance improvements and bug fixes since
the 2.18.1 release. We recommend that you upgrade at the next
available opportunity.

**Bugfixes**
* #7686 Potential wrong aggregation result when using vectorized aggregation with hash grouping in reverse order
* #7694 Fix ExplainHook breaking call chain
* #7695 Block dropping internal compressed chunks with `drop_chunk()`
* #7711 License error when using hypercore handler
* #7712 Respect other extensions' ExecutorStart hooks

**Thanks**
* @davidmehren and @jflambert for reporting an issue with extension hooks
* @jflambert for reporting a bug with license errors shown in autovacuum
2025-02-19 12:39:05 +01:00
Alexander Kuzmenkov
134ddbf9c8
Run the regression tests on ARM (#7718)
Add a single configuration that uses the Ubuntu22.04-2Core runner.
2025-02-18 18:13:58 +00:00
Alexander Kuzmenkov
eb2b1972d8
Trigger the backports when a release branch is updated (#7732)
This will help update the pending backport PR to the latest version of
the release branch.

GitHub doesn't provide a built-in possibility to trigger a workflow on
the main branch when another branch has changed. For example, if we had
a "push: ?.*.x" condition, it would trigger the backport workflow on the
release branch itself, which is not what we need. So we have to use a
helper workflow instead.
2025-02-18 14:24:14 -03:00
David Beck
c19f09b831 Fix sanitizer error by removing an invalid test
The problem with the test in compression_unti_test.c was that
tsl_bool_compressor_finish() expects a BoolCompressor and it
should get it from its pair: tsl_bool_compressor_append().

The test supplied an incompatible type (ExtendedCompressor)
coming from bool_compressor_for_type() and sanitizer caught it.

Disable-check: force-changelog-file
2025-02-18 17:10:03 +00:00
atovpeko
0db119d41b RTA updates 2025-02-18 11:26:20 -03:00
Fabrízio de Royes Mello
d49065c437 Better report message in check sql script 2025-02-18 11:26:03 -03:00
Ildar Musin
a1b950fe07 Block dropping internal compressed chunks
Dropping internal compressed chunks is blocked on DDL level, but
is still possible with `_timescaledb_functions.drop_chunk` function.
This patch adds a simple check to prevent that.
2025-02-18 15:08:01 +01:00
Sven Klemm
273f7964f3 Bump PG version used in CI to 14.16, 15.11, 16.7 and 17.3 2025-02-18 11:01:02 +01:00
Sven Klemm
0be697a4b1 Move FK query handling into own function
Split off the code for dealing with FK queries into own function.
No code is changed within this PR just moved around.
2025-02-18 10:58:31 +01:00
Sven Klemm
424642a26e Add thanks for executor hook fixes 2025-02-18 10:38:28 +01:00
Sven Klemm
8bf1f12268 Silence compiler warning about macro arguments
get_relmergeinfo macro produced the following warning:
macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
2025-02-18 10:31:19 +01:00
Pallavi Sontakke
c444b1a77d
Use origin instead of upstream for push
As it's a direct branch and not a fork.
2025-02-18 12:54:47 +05:30
David Beck
d7a8b4b8e2 Implement bool compression
Reusing the existing Simple8bRLE algorithm for bools. I added a new
compression type specifically for this case called 'bool'.

A new GUC is introduced so we can revert to the previous, array
compression for bools: `timescaledb.enable_bool_compression`.
It defaults to `false`.

To enable bool compression set the GUC:

`timescaledb.enable_bool_compression=true`

Fixes #7233
2025-02-17 19:16:35 +00:00
Erik Nordström
4128feb262 Add GUC for TAM arrow cache size
The arrow cache is used to cache decompressed arrow segments and is
mostly useful for index scans that access values across segments in
non-segment order.

The fixed cache size was set too small for index scans on bigger data
sets. Therefore, increase the default size and make it configurable via
a GUC.
2025-02-17 16:08:53 +01:00
Mats Kindahl
63ccf6aaa0 Load hypercore handler eagerly
If a crossmodule wrapper function is called as part of a query on a
fresh backend, it will generate a license error even if the license is
set correctly. This happens because the module load happens very late
(in `post_parse_analyze_hook`) but the function call is quite early.

This is fixed by eagerly loading the TSL module in the hypercore
handler function and hypercore index proxy handler function.
2025-02-17 11:29:13 +01:00
Ildar Musin
0fc733e00e Respect other extensions' ExecutorStart hooks
When we override ExecutorStart hook that has been set by another
extension we have to chain-call it not to disrupt other extension's
integrity.
2025-02-17 00:16:38 +01:00
Keyur Panchal
9b499aac1a
Optimize recompression for non-segmentby chunks (#7632)
Enables the segmentwise recompression flow to be used for chunks without
segmentby columns.

This should be more performant than doing a full recompression.
2025-02-14 21:01:40 +00:00
Sven Klemm
9382a90ada Support ALTER COLUMN SET NOT NULL on compressed chunks
This patch adds support for ALTER TABLE ALTER COLUMN SET NOT NULL
to compressed chunks. The statement will be allowed when no NULL
values for the specific column are present in compressed chunks.
2025-02-14 11:58:41 +01:00
Pallavi Sontakke
51a343c987
Set environment for gated action 2025-02-14 10:39:13 +05:30
Erik Nordström
af64c7bbfc Support vectorized aggregation on Hypercore TAM
Add support for running VectorAgg on top of scans on Hypercore
TAM. Currently, only ColumnarScan can run below VectorAgg when
Hypercore TAM is used. In theory, a SeqScan or IndexScan reading from
Hypercore TAM should also work because they would produce Arrow
slots. However, only ColumnarScan performs vectorized filtering, which
is currently assumed to happen before the VectorAgg node.

In ColumnarScan, it is necessary to turn off projection when VectorAgg
is used. Otherwise, it would project the arrow slot into a virtual
slot, thus losing the vector data. Ideally, a projection should never
be planned to begin with, but this isn't possible since VectorAgg
modifies existing non-vectorized Agg plans that already includes
projections.
2025-02-13 19:21:27 +01:00
Alexander Kuzmenkov
1464965878 Interface changes for the serialized hashing strategy
It needs to know the value size.
2025-02-13 19:21:27 +01:00
Alexander Kuzmenkov
eea28951e9
Vectorized hash grouping by a single text column (#7586)
Use the UMASH hashes that have a guaranteed lower bound on collisions as
the hash table keys.
2025-02-13 13:08:49 +00:00
Pallavi Sontakke
b85fee5f5d
Rename file 2025-02-13 18:26:44 +05:30
Pallavi Sontakke
db3ecb9b42
Schedule run on release-branch.
For the remaining nightly runs.

Remove reference to non-existent trigger/homebrew_test branch.

---------

Signed-off-by: Pallavi Sontakke <pallavi@timescale.com>
Co-authored-by: Philip Krauss <35487337+philkra@users.noreply.github.com>
2025-02-13 17:43:32 +05:30
Pallavi Sontakke
9ce7dc7faf
Correct syntax for setting env var 2025-02-13 15:27:43 +05:30
Pallavi Sontakke
5a936d5a87
Simplify environment variables setting 2025-02-13 12:30:47 +05:30
Sven Klemm
55fec68c17 Fix ExplainHook breaking call chain
Hooks in postgres are supposed to be chained and call the previous
hook in your own added hooks. Not calling previous hook will prevent
other extensions from having working hooks.
2025-02-12 17:10:39 +01:00
Alexander Kuzmenkov
385b36a05c
Fix the umash build (#7696)
Apparently the proper way to use the object libraries in cmake is to add
them to target_sources, not target_link_libraries.

The failing workflow:
https://github.com/timescale/timescaledb/actions/runs/13271561042/job/37052078190

Some references:
https://cprieto.com/posts/2020/06/cmake-and-object-libraries.html

https://cmake.org/pipermail/cmake/2018-June/067721.html

Disable-check: force-changelog-file
2025-02-12 13:48:53 +00:00
Mats Kindahl
e921b48f31 Revert one-reviewer rule for table access method 2025-02-12 11:18:37 +01:00
Pallavi Sontakke
ef00d9119c
Schedule coverity scan weekly on release branch.
Also, schedule sqlsmith daily on release branch.
2025-02-12 14:36:43 +05:30
Erik Nordström
7ac240080a Make VectorAgg support different child plans
Vectorized aggregation assumes that it runs on top of a
DecompressChunk child node, which makes it difficult to support other
child plans; including those that fetch data via Hypercore TAM.

Most of the DecompressChunk-specific code for planning VectorAgg
relates to identifying vectorizable columns. This code is moved to a
separate source file so that the main planning code is mostly
child-node independent.
2025-02-12 08:22:19 +01:00
Fabrízio de Royes Mello
6063464f6d Fix wrong crash error message on job history
Currently while a job is running we set `pid = SchedulerPid`,
`succeed = false` and `execution_finish=NOW()` and it leads to
confusion when querying either `timescaledb_information.job_errors`
or `timescaledb_information.job_history` views showing in the
`err_message = job crash detected, see server logs`. This information
is wrong and create confusion.

Fixed it by setting `succeed=NULL` and `pid=NULL` when the scheduler
launch the job and then when the job worker start to work then set
`pid=MyProcPid` (the worker PID) meaning that the job started and
didn't finished yet, and at the end of the execution we set
`succeed=TRUE or FALSE` and the `execution_finish=NOW()` to mark the
end of the job execution. Also adjusted the views to expose the
information properly.
2025-02-11 16:42:37 -03:00
Alexander Kuzmenkov
6ce2fc0df4
Fix vectorized hash agg in GroupAgg mode in reverse order (#7686)
The hash grouping strategies do not preserve the input order when the
compressed batches need to be reversed. Disable them in this case.
2025-02-11 16:06:57 +00:00
Mats Kindahl
d496a186d0 Restart launcher after bgw_scheduler_restart
If the scheduler is not restarted, it can affect other tests, so
restarting it at the end of the test.
2025-02-11 15:21:51 +01:00
Alexander Kuzmenkov
2d197a9572
Enable parallel index scans on compressed chunk table (#7659) 2025-02-11 12:33:10 +00:00
Sven Klemm
ab3d2471fe Release 2.18.1
This release contains performance improvements and bug fixes since
the 2.18.0 release. We recommend that you upgrade at the next
available opportunity.

**Features**
* [#7656](https://github.com/timescale/timescaledb/pull/7656) Remove limitation of compression policy for continuous aggregates

**Bugfixes**
* [#7600](https://github.com/timescale/timescaledb/pull/7600) Fix lock order when dropping index
* [#7637](https://github.com/timescale/timescaledb/pull/7637) Allow EXPLAIN in read-only mode
* [#7645](https://github.com/timescale/timescaledb/pull/7645) Fix DELETE on compressed chunk with non-btree operators
* [#7649](https://github.com/timescale/timescaledb/pull/7649) Allow non-btree operator pushdown in UPDATE/DELETE queries on compressed chunks
* [#7653](https://github.com/timescale/timescaledb/pull/7653) Push down orderby scankeys to Hypercore TAM
* [#7665](https://github.com/timescale/timescaledb/pull/7665) Block merging of frozen chunks
* [#7673](https://github.com/timescale/timescaledb/pull/7673) Don't abort additional INSERTs when hitting first conflict

**GUCs**
* `enable_hypercore_scankey_pushdown`: Push down qualifiers as scankeys when using Hypercore TAM introduced with [#7653](https://github.com/timescale/timescaledb/pull/7653)

**Thanks**
* @bjornuppeke for reporting a problem with INSERT INTO ... ON CONFLICT DO NOTHING on compressed chunks
* @ikalafat for reporting a problem with EXPLAIN in read-only mode
* Timescale community members Jacob and pantonis for reporting issues with slow queries.
2025-02-11 10:41:16 +01:00
Pallavi Sontakke
e2d3965bb7
prerelease test on release branch: github action
---------

Signed-off-by: Pallavi Sontakke <pallavi@timescale.com>
Co-authored-by: Philip Krauss <35487337+philkra@users.noreply.github.com>
2025-02-11 10:49:11 +05:30
Sven Klemm
773ae4a833 Remove outdated references to distributed hypertables 2025-02-10 15:49:53 +01:00
Alexander Kuzmenkov
89dfbc47c5
Disambiguate the merge_append_partially_compressed test (#7658)
Make the column sets used for ordering unique, otherwise the resulting
order depends on the plan.
2025-02-10 10:55:42 +00:00
Erik Nordström
121cd82be5 Block merging of frozen chunks
It should not be possible to merge a frozen chunk since it is used to
tier chunks. If the chunk is merged, it might no longer exist when the
tiering happens.
2025-02-10 10:13:41 +01:00
Sven Klemm
41b141fae3 Don't abort additional INSERTs when hitting first conflict
When an INSERT with ON CONFLICT DO NOTHING hits the first conflicts
it would abort additional INSERTS following the INSERT triggering
the DO NOTHING clause leading to missed INSERTs.

Fixes #7672
2025-02-10 09:10:07 +01:00
Sven Klemm
89062cb94b Improve metadata for PR 7637
Since we split the fixes and thanks messages into separate sections
in the changelog the context between fix and thanks will be lost so
the thanks note should repeat any required context
2025-02-10 09:04:21 +01:00
Sven Klemm
4ffca71fc9 Remove dead is_dist_call argument from ts_hypertable_create 2025-02-10 08:19:37 +01:00
Sven Klemm
25372dc20c Fix flaky bgw scheduler test
Reconnect after adjusting configuration to ensure our session has
it applied.
2025-02-08 00:03:01 +01:00
Sven Klemm
4fa5cf1d3e Adjust windows package test CI
Since we depend on the openssl version of the postgres installer
to match the openssl version we built against and we can't ensure
stability of that version in the postgres installer we only test
windows package against the latest available postgres version.
2025-02-07 23:50:12 +01:00
Erik Nordström
cde81858e8 Fix backwards scan on Hypercore TAM
Fix a bug when backwards scanning a ColumnarScan and add a test case.
2025-02-07 10:24:20 +01:00
Erik Nordström
8cff1c22a1 Optimize quals on segmentby columns in ColumnarScan
When filtering arrow slots in ColumnarScan, quals on segmentby columns
should be executed separately from those on other columns because they
don't require decompression and might filter the whole arrow slot in
one go. Furthermore, the quals only need to be applied once per arrow
slot since the segmentby value is the same for all compressed rows in
the slot.

This will speed up scans when filters on segmentby columns cannot be
pushed down to Hypercore TAM as scankeys. For example, "<column> IN
(1, 2, 3)" won't be pushed down as a scankey because only index scans
support scankeys with such scalar array expressions.
2025-02-07 10:24:20 +01:00
Rob Kiefer
30b47b894b Remove limitation of compression policy for continuous aggregates
Before compressed chunks were mutable, adding a compression policy
to a continuous aggregate that could include portions of the refrsh
window were blocked. When a continuous aggregate is refreshed, the
underlying chunks needed to allow DELETEs and INSERTs, so they
could not be compressed. Now, compressed chunks allow both operations
and there is no longer a need to prevent the refresh window and
compression window from overlapping.
2025-02-05 17:06:25 -05:00
Erik Nordström
d0c2bb722b Push down orderby scankeys to Hypercore TAM
Quals on orderby columns can be pushed down to Hypercore TAM and be
transformed to the corresponding min/max scankeys on the compressed
relation. Previously, only quals on non-compressed segmentby columns
were pushed down as scankeys.

Pushing down orderby scan keys seem to give a good performance boost
for columnar scans when no index exists.

The scankey push down can be disabled with a new GUC:

`timescaledb.enable_hypercore_scankey_pushdown=false`
2025-02-05 14:38:53 +01:00
Alexander Kuzmenkov
0eadff3bee
Update existing backports in the backport script (#7612)
Depending on the branch protection settings, we might have to update
them before they can be merged, so do this automatically to minimize the
required manual work.
2025-02-05 13:10:36 +00:00