Git Product home page Git Product logo

Comments (2)

canhld94 avatar canhld94 commented on July 21, 2024

I execute the following sql statement, the server hangs up.

set enable_optimizer = 1;
explain pipeline select xxx from xxx as A join xxx as B on A.name = B.name where A.name is not null;

The same sql statement will not have any errors when executed on the native clickhouse.

Hi @juppylm thanks for the feedback!
When using optimizer, the query execution model of Byconity is different from CH, so explain pipeline cannot run.
You can try to explain select xxx from xxx as A join xxx as B on A.name = B.name where A.name is not null;, but output meaning will also be different from native Clickhouse.
cc @Adora627 have we note this in the doccument?

from byconity.

canhld94 avatar canhld94 commented on July 21, 2024

For example, explaining an JOIN query will look like this:

EXPLAIN
SELECT
    sum(LO_REVENUE),
    toYear(LO_ORDERDATE) AS d_year,
    P_BRAND
FROM ssb100.lineorder, ssb100.part, ssb100.supplier
WHERE (LO_PARTKEY = P_PARTKEY) AND (LO_SUPPKEY = S_SUPPKEY) AND (P_CATEGORY = 'MFGR#12') AND (S_REGION = 'AMERICA')
GROUP BY
    d_year,
    P_BRAND
ORDER BY
    d_year ASC,
    P_BRAND ASC

Query id: 7876f063-a665-40de-9926-6083217455c5

┌─explain───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Projection est. 93873 rows, cost 7.398416e+08                                                                                             │
│ │     Expressions: [P_BRAND], d_year:=`expr#toYear(LO_ORDERDATE)`, sum(LO_REVENUE):=`expr#sum(LO_REVENUE)`                                │
│ └─ Sorting est. 93873 rows, cost 7.398347e+08                                                                                             │
│    │     Order by: {expr#toYear(LO_ORDERDATE) asc, P_BRAND asc}                                                                           │
│    └─ Gather Exchange est. 93873 rows, cost 7.398347e+08                                                                                  │
│       └─ Sorting est. 93873 rows, cost 7.398197e+08                                                                                       │
│          │     Order by: {expr#toYear(LO_ORDERDATE) asc, P_BRAND asc}                                                                     │
│          └─ MergingAggregated est. 93873 rows, cost 7.398197e+08                                                                          │
│             └─ Repartition Exchange est. 93873 rows, cost 7.398197e+08                                                                    │
│                │     Partition by: {P_BRAND, expr#toYear(LO_ORDERDATE)}                                                                   │
│                └─ Aggregating est. 93873 rows, cost 7.398046e+08                                                                          │
│                   │     Group by: {P_BRAND, expr#toYear(LO_ORDERDATE)}                                                                    │
│                   │     Aggregates: expr#sum(LO_REVENUE):=AggNull(sum)(LO_REVENUE)                                                        │
│                   └─ Projection est. 6742248 rows, cost 7.398046e+08                                                                      │
│                      │     Expressions: [LO_REVENUE, P_BRAND], expr#toYear(LO_ORDERDATE):=toYear(LO_ORDERDATE)                            │
│                      └─ Inner Join est. 6742248 rows, cost 7.393057e+08                                                                   │
│                         │     Condition: LO_SUPPKEY == S_SUPPKEY                                                                          │
│                         ├─ Inner Join est. 33634621 rows, cost 7.241307e+08                                                               │
│                         │  │     Condition: LO_PARTKEY == P_PARTKEY                                                                       │
│                         │  ├─ Local Exchange est. 600038145 rows, cost 4.884311e+08                                                       │
│                         │  │  └─ Filter est. 600038145 rows, cost 4.884311e+08                                                            │
│                         │  │     │     Dynamic Filters: {LO_PARTKEY:bloomfilter,LO_PARTKEY:range,LO_SUPPKEY:bloomfilter,LO_SUPPKEY:range} │
│                         │  │     └─ TableScan ssb100.lineorder est. 600038145 rows, cost 4.440282e+08                                     │
│                         │  │              Outputs: [LO_ORDERDATE, LO_PARTKEY, LO_REVENUE, LO_SUPPKEY]                                     │
│                         │  └─ Broadcast Exchange est. 55736 rows, cost 1.152642e+06                                                       │
│                         │     └─ Projection est. 55736 rows, cost 1.143724e+06                                                            │
│                         │        │     Expressions: [P_BRAND, P_CATEGORY, P_PARTKEY]                                                      │
│                         │        │     Dynamic Filters Builder: {P_PARTKEY}                                                               │
│                         │        └─ Filter est. 55736 rows, cost 1.139600e+06                                                             │
│                         │           │     Condition: P_CATEGORY = 'MFGR#12'                                                               │
│                         │           └─ TableScan ssb100.part est. 1400000 rows, cost 1.036000e+06                                         │
│                         │                    Outputs: [P_BRAND, P_CATEGORY, P_PARTKEY]                                                    │
│                         └─ Broadcast Exchange est. 40125 rows, cost 1.721894e+05                                                          │
│                            └─ Projection est. 40125 rows, cost 1.657693e+05                                                               │
│                               │     Expressions: [S_REGION, S_SUPPKEY]                                                                    │
│                               │     Dynamic Filters Builder: {S_SUPPKEY}                                                                  │
│                               └─ Filter est. 40125 rows, cost 1.628000e+05                                                                │
│                                  │     Condition: S_REGION = 'AMERICA'                                                                    │
│                                  └─ TableScan ssb100.supplier est. 200000 rows, cost 1.480000e+05                                         │
│                                           Outputs: [S_REGION, S_SUPPKEY]                                                                  │
│ note: Dynamic Filter is applied for 4 times.                                                                                              │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

from byconity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.