Skip to content

IGNITE-12819 Calcite integration. Cost system#8590

Closed
korlov42 wants to merge 11 commits into
apache:sql-calcitefrom
gridgain:ignite-12819
Closed

IGNITE-12819 Calcite integration. Cost system#8590
korlov42 wants to merge 11 commits into
apache:sql-calcitefrom
gridgain:ignite-12819

Conversation

@korlov42
Copy link
Copy Markdown
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

awaitPartitionMapExchange(true, true, null);

QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class);
QueryEngine engine = Commons.lookupComponent(ignite.context(), QueryEngine.class);
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.

hope we need to extend this and lower tests, append additional call from server nodes and check results for equality.

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.

think it should be done under separate ticket

@Test
public void testOrderByNoIndexedColumn() {
assertQuery("SELECT * FROM Developer ORDER BY age DESC")
.matches(containsTableScan("PUBLIC", "DEVELOPER"))
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.

possibly we need to append additional check for IndexScan usage here and all appropriate tests? If it`s beyond the scope of this ticket may be we need additional one?

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.

We don't. Every test should have only those checks which verifies a state the current test is suppose to verify.

public void testMergeJoin() {
assertQuery("" +
"SELECT d1.name, d2.name FROM Developer d1, Developer d2 WHERE d1.depId = d2.depId")
"SELECT /*+ DISABLE_RULE('CorrelatedNestedLoopJoin') */ d1.name, d2.name FROM Developer d1, Developer d2 WHERE d1.depId = d2.depId")
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 do we need it here? test passed without this change too.

Copy link
Copy Markdown
Contributor Author

@korlov42 korlov42 Dec 25, 2020

Choose a reason for hiding this comment

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

because in the middle of the task progress this test was failing several times because of changed plan. Since this test should verify only correctness of MergeJoin execution, I think it's OK to disable other algorithms explicitly

double rowCount = mq.getRowCount(getInput());

return planner.getCostFactory().makeCost(rowCount,
rowCount * (IgniteCost.ROW_COMPARISON_COST + IgniteCost.ROW_PASS_THROUGH_COST), 0);
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.

not obvious here, can u explain plz ? why : IgniteCost.ROW_COMPARISON_COST + IgniteCost.ROW_PASS_THROUGH_COST

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.

TrimExchange just filter out rows which don't met the distribution function's. So the cost function is the same as for IgniteFilter

return super.computeSelfCost(planner, mq).plus(planner.getCostFactory().makeTinyCost());
double rows = table.getRowCount();

double cost = rows * IgniteCost.ROW_PASS_THROUGH_COST;
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.

u can place this cost computation under "else" scope.

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.

yep, but I would prefer to left this as is, If you don't mind

@dspavlov
Copy link
Copy Markdown
Contributor

dspavlov commented Aug 6, 2021

This PR is associated with a resolved ticket. Closing the PR, please reopen it if you still need it.

@dspavlov dspavlov closed this Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants