Skip to content

[BUG]sql timeout #1034

@jjrrzxc

Description

@jjrrzxc

SQLBot Version
1.7

Run Mode
Is it running in a Docker container or running from source code?
docker

Describe the bug
A clear and concise description of what the bug is.

Image sqlbot跑数超时 但其实在客户端跑这个sql20秒内是能跑出来的, sql如下: SELECT `s`.`tenant_name` AS `tenant_name`, `s`.`actual_received_amount` AS `actual_received_amount`, `w`.`actual_consumed_amount` AS `actual_consumed_amount`, `c`.`new_customer_count` AS `new_customer_count` FROM (SELECT `t1`.`tenantcode`, MAX(`t1`.`tenant_name`) AS `tenant_name`, SUM(`t1`.`cash_amt`) AS `actual_received_amount` FROM `dtbt`.`dmt_sale_analysis_ilu_dd` `t1` WHERE `t1`.`order_date` >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY `t1`.`tenantcode`) `s` JOIN (SELECT `t2`.`tenantcode`, SUM(`t2`.`exec_amt`) AS `actual_consumed_amount` FROM `dtbt`.`dmt_write_off_analysis_ilu_dd` `t2` WHERE `t2`.`biz_date` >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY `t2`.`tenantcode`) `w` ON `s`.`tenantcode` = `w`.`tenantcode` JOIN (SELECT `t3`.`tenantcode`, COUNT(DISTINCT `t3`.`customer_id`) AS `new_customer_count` FROM `dtbt`.`dim_customer_analysis_irn_dd` `t3` WHERE `t3`.`frist_deal_date` >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY `t3`.`tenantcode`) `c` ON `s`.`tenantcode` = `c`.`tenantcode` ORDER BY `s`.`actual_received_amount` DESC LIMIT 10

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions