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

[Bug]: MySQL语法报错后解析性能直线下降 #377

Open
JackWang032 opened this issue Dec 4, 2024 · 6 comments
Open

[Bug]: MySQL语法报错后解析性能直线下降 #377

JackWang032 opened this issue Dec 4, 2024 · 6 comments
Assignees

Comments

@JackWang032
Copy link
Collaborator

Version

v4.x

Which SQL?

MySQL

SQL content

CREATE TABLE table_97 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_97 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_97 AS
SELECT
    *
FROM
    origin_table_97;

CREATE TABLE table_98 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_98 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_98 AS
SELECT
    *
FROM
    origin_table_98;

CREATE TABLE table_99 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_99 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_99 AS
SELECT
    *
FROM
    origin_table_99;

CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;


CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;


CREATE TABLE table_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE table_exists_100 (col1 INT, col2 INT, col3 INT);

CREATE TABLE derived_table_100 AS
SELECT
    *
FROM
    origin_table_100;

SELECT 
    A.user_id,
    A.user_name,
    B.total_order_amount,
    C.average_product_price,
    D.max_order_date,
    E.min_quantity,
    F.product_category_count
FROM 
    -- has error after 'FROM'
    (SELECT user_id, user_name FROM  ) A
JOIN 
    (SELECT user_id, SUM(order_total) AS total_order_amount
     FROM orders
     GROUP BY user_id) B ON A.user_id = B.user_id
JOIN 
    (SELECT O.user_id, AVG(P.price) AS average_product_price
     FROM orders O
     JOIN order_items OI ON O.order_id = OI.order_id
     JOIN products P ON OI.product_id = P.product_id
     GROUP BY O.user_id) C ON A.user_id = C.user_id
JOIN 
    (SELECT user_id, MAX(order_date) AS max_order_date
     FROM orders
     GROUP BY user_id) D ON A.user_id = D.user_id;

JavaScript/TypeScript code

No response

What happened?

补全、语法校验卡死
iShot_2024-12-04_10 18 49

Relevant log output

No response

@qinyouzhi
Copy link

我也遇到了此类问题 100条sql就出现解析卡顿

@JackWang032
Copy link
Collaborator Author

我也遇到了此类问题 100条sql就出现解析卡顿

是Next版本吗, MySQL与PG非官方的语法文件嵌套结构太多本身就存在很大的性能问题

@qinyouzhi
Copy link

[email protected] 使用的是MySQL语言

@JackWang032
Copy link
Collaborator Author

[email protected] 使用的是MySQL语言

那应该是由于MySQL本身语法文件书写嵌套层级过多导致的,需要对语法文件进行精简,所以短时间内可能解决不了MySQL的性能问题

@JackWang032
Copy link
Collaborator Author

能再提供下具体的SQL吗

@qinyouzhi
Copy link

抱歉。 是用户发现的 拿不到具体sql。

是想用spark引擎的。 不知道之前的spark问题有没有修复 DTStack/monaco-sql-languages#134

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

2 participants