Open cd-gumo opened 3 weeks ago
I am kind of confused why you have this filter in the subquery since you have the exact same filter in the top query
AND kendat.kind = 179
Removing that resolves the issue, does that give you the expected results? I tried this on your repro case and get no rows returned.
You are right, this filter is useless and can be omitted. Query is successful without this filter, thank you.
Still, it is unexpected that timescaledb results in an error here with valid SQL syntax where PostgreSQL does not. Therefore I consider this as a bug.
I'd agree, will put it on the backlog.
Thanks you for your report!
What type of bug is this?
Unexpected error
What subsystems and features are affected?
Query planner
What happened?
Query planner throws an error for the following query:
ERROR does not occur without timescaledb or disabled SkipScan.
TimescaleDB version affected
2.15.2
PostgreSQL version used
15.7
What operating system did you use?
Debian 12.2.0-14
What installation method did you use?
Deb/Apt
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
How can we reproduce the bug?
execute query/explain
We tried reordering the Index for the DISTINCT column without success.