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

DataShard Lookups SVG visualizations #15860

Open
Hor911 opened this issue Mar 17, 2025 · 7 comments
Open

DataShard Lookups SVG visualizations #15860

Hor911 opened this issue Mar 17, 2025 · 7 comments
Assignees

Comments

@Hor911
Copy link
Collaborator

Hor911 commented Mar 17, 2025

Display:

  • tables as external sources
  • table names
  • lookup and read columns
  • relations to stages
  • statistics (best effort)
@Hor911 Hor911 self-assigned this Mar 17, 2025
@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

  1. TablePointLookup, TPC-H Q10 (EnableKqpDataQueryStreamLookup = false, EnableKqpDataQueryStreamIdxLookupJoin = false)
"Plans" : [
    {
        "Tables" : [
            "tpch/nation"
        ],
        "PlanNodeId" : 25,
        "Operators" : [
            {
                "Inputs" : [
                    {
                        "InternalOperatorId" : 1
                    }
                ],
                "GroupBy" : "[item.c_acctbal,item.c_address,item.c_comment,item.c_custkey,item.c_name,item.c_phone,item.n_name]",
                "Aggregation" : "{SUM(item.l_extendedprice * (1 - item.l_discount))}",
                "Name" : "Aggregate",
                "Phase" : "Intermediate"
            },
            {
                "Inputs" : [
                    {
                        "InternalOperatorId" : 3
                    },
                    {
                        "InternalOperatorId" : 2
                    }
                ],
                "E-Rows" : "No estimate",
                "Condition" : "n.n_nationkey = c.c_nationkey",
                "Name" : "InnerJoin (MapJoin)",
                "E-Size" : "No estimate",
                "E-Cost" : "No estimate"
            },
            {
                "Inputs" : [ ],
                "ToFlow" : "precompute_2_0",
                "Name" : "ToFlow"
            },
            {
                "Inputs" : [
                    {
                        "InternalOperatorId" : 4
                    }
                ],
                "E-Rows" : "No estimate",
                "Predicate" : "Exist(item.n_nationkey)",
                "Name" : "Filter",
                "E-Size" : "No estimate",
                "E-Cost" : "No estimate"
            },
            {
                "E-Size" : "No estimate",
                "Name" : "TablePointLookup",
                "Inputs" : [
                    {
                        "InternalOperatorId" : 5
                    }
                ],
                "Path" : "/Root/tpch/nation",
                "E-Rows" : "No estimate",
                "Table" : "tpch/nation",
                "ReadColumns" : [
                    "n_name",
                    "n_nationkey"
                ],
                "E-Cost" : "No estimate"
            },
            {
                "Inputs" : [ ],
                "Iterator" : "precompute_3_0",
                "Name" : "Iterator"
            }
        ],
        "Node Type" : "Aggregate-InnerJoin (MapJoin)-ConstantExpr-Filter-TablePointLookup-ConstantExpr"
    }
]

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

  1. TableRangeScan, TPC-H Q10 (EnableKqpDataQueryStreamLookup = false, EnableKqpDataQueryStreamIdxLookupJoin = false)
"Plans" : [
    {
        "Tables" : [
            "tpch/lineitem"
        ],
        "PlanNodeId" : 17,
        "Operators" : [
            {
                "Inputs" : [
                    {
                        "InternalOperatorId" : 2
                    },
                    {
                        "InternalOperatorId" : 1
                    }
                ],
                "E-Rows" : "No estimate",
                "Condition" : "l.l_orderkey = o.o_orderkey",
                "Name" : "InnerJoin (MapJoin)",
                "E-Size" : "No estimate",
                "E-Cost" : "No estimate"
            },
            {
                "Inputs" : [ ],
                "ToFlow" : "precompute_0_0",
                "Name" : "ToFlow"
            },
            {
                "Inputs" : [
                    {
                        "InternalOperatorId" : 3
                    }
                ],
                "E-Rows" : "No estimate",
                "Predicate" : "Exist(item.l_orderkey) AND item.l_returnflag == \"R\"",
                "Name" : "Filter",
                "E-Size" : "No estimate",
                "E-Cost" : "No estimate"
            },
            {
                "E-Size" : "No estimate",
                "Name" : "TableRangeScan",
                "Inputs" : [
                    {
                        "InternalOperatorId" : 4
                    }
                ],
                "Path" : "/Root/tpch/lineitem",
                "E-Rows" : "No estimate",
                "Table" : "tpch/lineitem",
                "ReadColumns" : [
                    "l_discount",
                    "l_extendedprice",
                    "l_orderkey",
                    "l_returnflag"
                ],
                "E-Cost" : "No estimate"
            },
            {
                "Inputs" : [ ],
                "Iterator" : "precompute_1_0",
                "Name" : "Iterator"
            }
        ],
        "Node Type" : "InnerJoin (MapJoin)-ConstantExpr-Filter-TableRangeScan-ConstantExpr",
    }
]

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

TablePointLookup + TableRangeScan

Image

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

  1. TableLookup, TPC-H Q10 (EnableKqpDataQueryStreamLookup = true, EnableKqpDataQueryStreamIdxLookupJoin = false)
"Plans" : [
    {
        "E-Size" : "No estimate",
        "PlanNodeId" : 20,
        "LookupKeyColumns" : [
            "n_nationkey"
        ],
        "Node Type" : "TableLookup",
        "Path" : "/Root/tpch/nation",
        "Columns" : [
            "n_name",
            "n_nationkey"
        ],
        "E-Rows" : "No estimate",
        "Table" : "tpch/nation",
        "Plans" : [
            {
                "PlanNodeId" : 19,
                "Operators" : [
                    {
                        "Inputs" : [
                            {
                                "InternalOperatorId" : 1
                            }
                        ],
                        "Iterator" : "PartitionByKey",
                        "Name" : "Iterator"
                    },
                    {
                        "Inputs" : [ ],
                        "Name" : "PartitionByKey",
                        "Input" : "precompute_1_0"
                    }
                ]
            }
        ]
    }
]

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

TableLookup

Image

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

  1. TableLookupJoin, TPC-H Q10 (EnableKqpDataQueryStreamLookup = true, EnableKqpDataQueryStreamIdxLookupJoin = true)
"Plans" : [
    {
        "E-Size" : "No estimate",
        "PlanNodeId" : 8,
        "LookupKeyColumns" : [
            "l_orderkey"
        ],
        "Node Type" : "TableLookupJoin",
        "Path" : "/Root/tpch/lineitem",
        "Columns" : [
            "l_discount",
            "l_extendedprice",
            "l_orderkey",
            "l_returnflag"
        ],
        "E-Rows" : "No estimate",
        "Table" : "tpch/lineitem",
        "Plans" : [
            {
                "PlanNodeId" : 7,
                "Plans" : [
                    {
                        "Tables" : [
                            "tpch/customer"
                        ],
                        "PlanNodeId" : 6,
                        "Operators" : [
                            {
                                "Scan" : "Parallel",
                                "E-Size" : "No estimate",
                                "ReadRanges" : [
                                    "c_custkey (-∞, +∞)"
                                ],
                                "Name" : "TableFullScan",
                                "Inputs" : [ ],
                                "Path" : "/Root/tpch/customer",
                                "ReadRangesPointPrefixLen" : "0",
                                "E-Rows" : "No estimate",
                                "Table" : "tpch/customer",
                                "ReadColumns" : [
                                    "c_acctbal",
                                    "c_address",
                                    "c_comment",
                                    "c_custkey",
                                    "c_name",
                                    "c_nationkey",
                                    "c_phone"
                                ],
                                "E-Cost" : "No estimate"
                            }
                        ],
                        "Node Type" : "TableFullScan"
                    }
                ]
            }
        ]
    }
]

@Hor911
Copy link
Collaborator Author

Hor911 commented Mar 17, 2025

TableLookupJoin

Image

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

No branches or pull requests

1 participant