Skip to content

[Bug]: Dropped quals in SkipScan cause incorrect results #8217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
natalya-aksman opened this issue Jun 3, 2025 · 0 comments · Fixed by #8216
Closed

[Bug]: Dropped quals in SkipScan cause incorrect results #8217

natalya-aksman opened this issue Jun 3, 2025 · 0 comments · Fixed by #8216
Assignees

Comments

@natalya-aksman
Copy link
Member

What type of bug is this?

Incorrect result

What subsystems and features are affected?

SkipScan

What happened?

See https://github.com/timescale/Support-Dev-Collab/issues/2976.

When we have multi-column index and have an index qual on a column with attribute number bigger than the number of index quals, we would drop the qual.

TimescaleDB version affected

2.20.0

PostgreSQL version used

17.4

What operating system did you use?

Ubuntu 24

What installation method did you use?

Source

What platform did you run on?

Other

Relevant log output and stack trace

How can we reproduce the bug?

\i tsl/test/sql/include/skip_scan_load.sql
    \set TABLE skip_scan

    -- Used to drop "dev_name IS NULL" qual and return extra records
    CREATE INDEX skip_scan_idx_time_dev_dname ON :TABLE(time,dev,dev_name);
    :PREFIX SELECT DISTINCT time FROM :TABLE WHERE dev_name IS NULL ORDER BY 1;
    DROP INDEX skip_scan_idx_time_dev_dname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant