Skip to content
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

Fix 'set' skip index not working with IN, indexHint(), and subqueries #62083

Merged
merged 7 commits into from
Jun 1, 2024

Conversation

al13n321
Copy link
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fixed 'set' skip index not working with IN and indexHint()

Example:

create table a (k UInt64, v UInt64, index i (v) type set(100) granularity 2) engine MergeTree order by k;
insert into a select number, intDiv(number, 4096) from numbers(1000000);
select sum(1+ignore(*)) from a where indexHint(v in (20, 40));

Without the fix it outputs 1000000 (i.e. reads all 1M rows), with the fix 32768 (i.e. reads 4 granules, as expected).

Also works with subqueries now:

select sum(1+ignore(*)) from a where indexHint(v in (select 20 union all select 40));

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-bugfix Pull request with bugfix, not backported by default label Mar 29, 2024
@robot-clickhouse-ci-1
Copy link
Contributor

robot-clickhouse-ci-1 commented Mar 29, 2024

This is an automated comment for commit c22a4b7 with description of existing statuses. It's updated for the latest CI running

⏳ Click here to open a full report in a separate page

Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Successful checks
Check nameDescriptionStatus
A SyncIf it fails, ask a maintainer for help✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success

@jkartseva jkartseva self-assigned this Apr 5, 2024
Comment on lines 350 to 351
*storage = actions_clone->getOutputs();
result_dag_or_null->mergeNodes(std::move(*actions_clone));
Copy link
Contributor

@jkartseva jkartseva Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the node pointers copied to store remain valid after actions are passed to mergeNodes?
Okay, the function does not modify the pointers so should be fine.

@al13n321 al13n321 force-pushed the seth branch 2 times, most recently from 04164d6 to a666fed Compare May 10, 2024 22:02
@alexey-milovidov
Copy link
Member

@al13n321, fuzzers have found a lot of errors.

@al13n321
Copy link
Member Author

al13n321 commented Jun 1, 2024

The failed test is unrelated (SELECT * FROM loop('', '') crashes the server - candidate for the shortest query that does that :) ).

EDIT: #64716

@al13n321 al13n321 enabled auto-merge June 1, 2024 07:48
@al13n321 al13n321 added this pull request to the merge queue Jun 1, 2024
Merged via the queue into master with commit 546660f Jun 1, 2024
62 of 79 checks passed
@al13n321 al13n321 deleted the seth branch June 1, 2024 21:22
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 1, 2024
@DerekChia
Copy link
Contributor

@al13n321 possible to backport at least to 24.3 LTS? It's been broken for a while - #65141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants