pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.39k stars 5.73k forks source link

Unity #52907

Open qw4990 opened 1 month ago

qw4990 commented 1 month ago

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What changed and how does it work?

 explain format='unity' select * from t1, t2 where t1.a=1 and t1.b>t2.b;

{
    "Tables": {
        "test.t1": {
            "AsName": "", 
            "Columns": {
                "test.t1.a": {
                    "NDV": 2000, 
                    "Nulls": 0, 
                    "Min": "500", 
                    "Max": "1999", 
                    "Histogram": [
                        {
                            "Lower": "500", 
                            "Upper": "505", 
                            "Count": 7
                        }, 
                        {
                            "Lower": "506", 
                            "Upper": "511", 
                            "Count": 6
                        }
                    ]
                }, 
                "test.t1.b": {
                    "NDV": 2000, 
                    "Nulls": 0, 
                    "Min": "500", 
                    "Max": "1999", 
                    "Histogram": [
                        {
                            "Lower": "500", 
                            "Upper": "505", 
                            "Count": 7
                        }, 
                        {
                            "Lower": "506", 
                            "Upper": "511", 
                            "Count": 6
                        }
                    ]
                }
            }, 
            "Indexes": {
                "test.t1.a": {
                    "NDV": 2000, 
                    "Nulls": 0
                }
            }, 
            "RealtimeRows": 2000, 
            "ModifiedRows": 0
        }, 
        "test.t2": {
            "AsName": "", 
            "Columns": {
                "test.t2.b": {
                    "NDV": 2000, 
                    "Nulls": 0, 
                    "Min": "500", 
                    "Max": "1999", 
                    "Histogram": [
                        {
                            "Lower": "500", 
                            "Upper": "505", 
                            "Count": 7
                        }, 
                        {
                            "Lower": "506", 
                            "Upper": "511", 
                            "Count": 6
                        } 
                    ]
                }
            }, 
            "Indexes": {
                "test.t2.a": {
                    "NDV": 2000, 
                    "Nulls": 0
                }
            }, 
            "RealtimeRows": 2000, 
            "ModifiedRows": 0
        }
    }, 
    "Hints": [
        "merge_join(test.t1)", 
        "use_index(test.t2, test.t2.a)", 
        "index_join(test.t1)", 
        "leading(test.t1, test.t2)", 
        "hash_join(test.t1)", 
        "leading(test.t2, test.t1)", 
        "use_index(test.t1, test.t1.a)", 
        "hash_join(test.t2)", 
        "merge_join(test.t2)", 
        "index_join(test.t2)"
    ]
}

Check List

Tests

Side effects

Documentation

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None
ti-chi-bot[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from qw4990, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/pingcap/tidb/blob/master/OWNERS)** - **[pkg/planner/OWNERS](https://github.com/pingcap/tidb/blob/master/pkg/planner/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
tiprow[bot] commented 1 month ago

Hi @qw4990. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ti-chi-bot[bot] commented 5 days ago

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/invalid-title label, please follow title format, for example pkg [, pkg2, pkg3]: what is changed or *: what is changed.

:open_book: For more info, you can check the "Contribute Code" section in the development guide.


Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

:open_book: For more info, you can check the "Contribute Code" section in the development guide.


Notice: To remove the do-not-merge/needs-tests-checked label, please finished the tests then check the finished items in description.

For example:

Tests

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

:open_book: For more info, you can check the "Contribute Code" section in the development guide.

ti-chi-bot[bot] commented 5 days ago

@qw4990: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test 83cd0888a2a68d40dfb6110bfdedcda61a49c9c4 link true /test unit-test
idc-jenkins-ci-tidb/build 83cd0888a2a68d40dfb6110bfdedcda61a49c9c4 link true /test build
idc-jenkins-ci-tidb/check_dev 83cd0888a2a68d40dfb6110bfdedcda61a49c9c4 link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 83cd0888a2a68d40dfb6110bfdedcda61a49c9c4 link true /test check-dev2

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).