Skip to content

tici: support count pushdown to tici searchlib - #10428

Merged
ti-chi-bot[bot] merged 5 commits into
pingcap:feature/ftsfrom
wshwsh12:agg
Sep 17, 2025
Merged

ti-chi-bot[bot] merged 5 commits into
pingcap:feature/ftsfrom
wshwsh12:agg

Conversation

@wshwsh12

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What is changed and how it works?


Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 15, 2025
@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 15, 2025
Comment thread dbms/src/Flash/Coprocessor/TiCIScan.h Resolved

bool isOnlyOneCount() const
{
return aggregate_descriptions.size() == 1 && aggregate_descriptions[0].function->getName() == "count";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why count's argument is not checked?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed. I check aggregate_descriptions[0].argument_names.empty()

Comment thread dbms/src/Flash/Planner/optimize.cpp Outdated
if (plan->tp() == PlanType::Aggregation)
{
auto agg = std::static_pointer_cast<PhysicalAggregation>(plan);
if (agg->isOnlyOneCount())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And this agg should not have group by key?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And count(distinct) is not supported?

@wshwsh12 wshwsh12 Sep 15, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And this agg should not have group by key?

Addressed. I check aggregation_keys.empty().

And count(distinct) is not supported?

distinct is not supported in tici, so tici will return all data, and tiflash will process it.

Comment thread dbms/src/Flash/Planner/optimize.cpp Resolved

protected:
Block readFromS3(size_t processing)
Block readFromS3(size_t processing, bool is_count)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is remote read well handled for this agg push down?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, remote read sends a cop request without any agg info, so the remote tiflash will read the actual data and return.

@wshwsh12
wshwsh12 requested a review from windtalker September 15, 2025 16:13

@windtalker windtalker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 17, 2025
@ti-chi-bot

ti-chi-bot Bot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guo-shaoge, windtalker

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [guo-shaoge,windtalker]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 17, 2025
@ti-chi-bot

ti-chi-bot Bot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2025-09-17 06:17:43.834994485 +0000 UTC m=+1033330.394875972: ☑️ agreed by windtalker.
  • 2025-09-17 07:10:38.112068209 +0000 UTC m=+1036504.671949706: ☑️ agreed by guo-shaoge.

@ti-chi-bot
ti-chi-bot Bot merged commit b2fa044 into pingcap:feature/fts Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants