Fix DISTINCT query with JOIN on multiple segmentby columns#5680
Fix DISTINCT query with JOIN on multiple segmentby columns#5680konskov merged 1 commit intotimescale:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5680 +/- ##
==========================================
+ Coverage 87.71% 90.98% +3.26%
==========================================
Files 231 230 -1
Lines 54803 54624 -179
Branches 12055 0 -12055
==========================================
+ Hits 48073 49697 +1624
- Misses 4902 4927 +25
+ Partials 1828 0 -1828
... and 190 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c902339 to
df3e4cd
Compare
| -- github issue 5585 | ||
| create table kon ( | ||
| time timestamptz not null, | ||
| a varchar(255) not null, | ||
| b int, | ||
| c int | ||
| ); | ||
| SELECT create_hypertable('kon', 'time'); | ||
| WARNING: column type "character varying" used for "a" does not follow best practices |
There was a problem hiding this comment.
What do you think about putting this into a separate file? This one's output is already 9k lines, and it's versioned, it's becoming unwieldy.
There was a problem hiding this comment.
sure, I will create a new test file for this, is transparent_decompression_idx_join a good name? and should this test be versioned as well? I think it would be good to make it a versioned test since transparent_decompression is too
Edit: I see we already have transparent_decompression_ordered_index which looks like a better place to add this test
There was a problem hiding this comment.
Yep, that one is smaller. About versions, I try to avoid them when possible, because they are inconvenient to work with.
akuzm
left a comment
There was a problem hiding this comment.
Doesn't look like it would harm. Just don't forget to add the proper node type checks, now you have a raw cast.
dee2300 to
832ebea
Compare
|
@gayyappan, @nikkhils: please review this pull request.
|
547c191 to
608a5d3
Compare
|
Thank you for reviewing @akuzm! Actually I’m not sure what node type checks to add and where, could you point them out if it’s not too much trouble? Thank you so much! |
I just meant the |
4348919 to
4a31991
Compare
| -- force an index scan | ||
| set enable_seqscan = 'off'; | ||
| -- disable jit to avoid test flakiness | ||
| set jit_above_cost = -1; |
There was a problem hiding this comment.
| set jit_above_cost = -1; | |
| set jit = off; |
This is the correct way to complete turn off JIT
| -- force an index scan | ||
| set enable_seqscan = 'off'; | ||
| -- disable jit to avoid test flakiness | ||
| set jit_above_cost = -1; |
There was a problem hiding this comment.
| set jit_above_cost = -1; | |
| set jit = off; |
This is the correct way to complete turn off JIT
Previously when adding equivalence class members for the compressed chunk's variables, we would only consider Vars. This led us to ignore cases where the Var was wrapped in a RelabelType, returning inaccurate results. Fixed the issue by accepting Vars with RelabelType for segmentby equivalence class. Fixes timescale#5585
4a31991 to
07433cc
Compare
|
Automated backport to 2.10.x not done: cherry-pick failed. Git status |
This release contains bug fixes since the 2.11.0 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * #5923 Feature flags for TimescaleDB features **Bugfixes** * #5680 Fix DISTINCT query with JOIN on multiple segmentby columns * #5774 Fixed two bugs in decompression sorted merge code * #5786 Ensure pg_config --cppflags are passed * #5906 Fix quoting owners in sql scripts. * #5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * timescale#5923 Feature flags for TimescaleDB features **Bugfixes** * timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns * timescale#5774 Fixed two bugs in decompression sorted merge code * timescale#5786 Ensure pg_config --cppflags are passed * timescale#5906 Fix quoting owners in sql scripts. * timescale#5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * #5923 Feature flags for TimescaleDB features **Bugfixes** * #5680 Fix DISTINCT query with JOIN on multiple segmentby columns * #5774 Fixed two bugs in decompression sorted merge code * #5786 Ensure pg_config --cppflags are passed * #5906 Fix quoting owners in sql scripts. * #5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * #5923 Feature flags for TimescaleDB features **Bugfixes** * #5680 Fix DISTINCT query with JOIN on multiple segmentby columns * #5774 Fixed two bugs in decompression sorted merge code * #5786 Ensure pg_config --cppflags are passed * #5906 Fix quoting owners in sql scripts. * #5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * #5923 Feature flags for TimescaleDB features **Bugfixes** * #5680 Fix DISTINCT query with JOIN on multiple segmentby columns * #5774 Fixed two bugs in decompression sorted merge code * #5786 Ensure pg_config --cppflags are passed * #5906 Fix quoting owners in sql scripts. * #5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
Previously when adding equivalence class members for the compressed
chunk's variables, we would only consider Vars. This led us to ignore
cases where the Var was wrapped in a RelabelType,
returning inaccurate results.
Fixed the issue by accepting Vars
with RelabelType for segmentby equivalence class.
Fixes #5585