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

[CBRD-24516] replace the information which is printed in "show trace" from aggregate function optimization #3892

Merged
merged 19 commits into from
Nov 15, 2022

Conversation

beyondykk9
Copy link
Contributor

@beyondykk9 beyondykk9 commented Oct 18, 2022

http://jira.cubrid.org/browse/CBRD-24516

The trace information is printed from "show trace" command, however, the aggregate optimzation-related information is not printed.

The information including aggregate optimized should be shown from "show trace" in case of aggregate optimization enabled. The below is an sample information.

trace
======================
  '
Query Plan:
  INDEX AGG OPTIMIZED (dba.mx)  
  rewritten query: select max([dba.mx].a) from [dba.mx] [dba.mx]

Trace Statistics:
  SELECT (time: 0, fetch: 12, ioread: 1)
    SCAN (table: dba.mx), (aggregate optimized, time: 0, fetch: 0, ioread: 0)

The modified code has 2 parts in "agg-optimized" setting.

  1. optimizer
    the plan's scan has "plan_un.scan.agg_optimized"

  2. scanner
    executor's scanner has "scan_stats.agg_optimized_scan"

@beyondykk9 beyondykk9 added this to the fig milestone Oct 18, 2022
@beyondykk9 beyondykk9 self-assigned this Oct 18, 2022
@beyondykk9 beyondykk9 changed the title replace trace information [CBRD-24516] replace the information which is printed in "show trace" from aggregate function optimization Oct 18, 2022
@beyondykk9 beyondykk9 marked this pull request as draft October 31, 2022 00:16
@beyondykk9 beyondykk9 marked this pull request as ready for review November 2, 2022 00:39
@beyondykk9
Copy link
Contributor Author

beyondykk9 commented Nov 3, 2022

The failed cases should be modified to reflect the changed TRACE text as following example:
See the "INDEX AGG OPTIMIZED" and "aggregate optimized" carefully.

  INDEX AGG OPTIMIZED (dba.mx)  rewritten query: select max([dba.mx].a) from [dba.mx] [dba.mx]Trace Statistics:
    SELECT (time: 0, fetch: 12, ioread: 1)
      SCAN (table: dba.mx), (aggregate optimized, time: 0, fetch: 0, ioread: 0)

else
{
fprintf (fp, "TABLE SCAN (%s)", class_name);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since it is determined by the executor, it is not possible to output to the plan.

Copy link
Contributor Author

@beyondykk9 beyondykk9 Nov 6, 2022

Choose a reason for hiding this comment

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

I think, however, the plan could be different from executing. Therefore, we need to print both of the plan and scan method in executing together in order to check whether the plan and scan method is same or different.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so. Inaccurate plan information will only confuse users.

@beyondykk9 beyondykk9 merged commit 8949033 into CUBRID:develop Nov 15, 2022
@beyondykk9 beyondykk9 deleted the CBRD-24516 branch November 15, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants