GreatSQL社区

搜索

[待回复] turbo 执行计划打印到error log

163 3 5 天前
test case:

  1. mysql> create schema mydbt;
  2. Query OK, 1 row affected (0.02 sec)

  3. mysql> create table mydbt.t1 (id int);
  4. Query OK, 0 rows affected (0.01 sec)

  5. mysql> insert mydbt.t1 select 1;
  6. Query OK, 1 row affected, 1 warning (0.00 sec)
  7. Records: 1  Duplicates: 0  Warnings: 1

  8. Warning (Code 8585): turbo does not support this sql statement: {"exception_type":"Parser","exception_message":"From DUAL clause is not yet supported"}
  9. mysql> insert mydbt.t1 select 1;
  10. Query OK, 1 row affected, 1 warning (0.00 sec)
  11. Records: 1  Duplicates: 0  Warnings: 1

  12. Warning (Code 8585): turbo does not support this sql statement: {"exception_type":"Parser","exception_message":"From DUAL clause is not yet supported"}
  13. mysql> insert mydbt.t1 select 1;
  14. Query OK, 1 row affected, 1 warning (0.00 sec)
  15. Records: 1  Duplicates: 0  Warnings: 1

  16. Warning (Code 8585): turbo does not support this sql statement: {"exception_type":"Parser","exception_message":"From DUAL clause is not yet supported"}
  17. mysql>
  18. mysql>
  19. mysql> EXPLAIN analyze SELECT /*+ SET_VAR(turbo_enable=ON) SET_VAR(turbo_cost_threshold=0) */ * FROM mydbt.t1;
  20. +-----------------------------------------------------------------------------------------------------------+
  21. | EXPLAIN                                                                                                   |
  22. +-----------------------------------------------------------------------------------------------------------+
  23. | -> Turbo scan
  24.     -> Table scan on t1, column(id)  (cost=0.3, row=3) (actual time=4.887 rows=3 loops=1)

  25. |
  26. +-----------------------------------------------------------------------------------------------------------+
  27. 1 row in set (0.02 sec)

  28. mysql> show var^C
  29. ^C
  30. mysql> show variables like '%turbo%';
  31. +---------------------------------+--------------------+
  32. | Variable_name                   | Value              |
  33. +---------------------------------+--------------------+
  34. | turbo_compat_func               | ON                 |
  35. | turbo_condition_pushdown        | OFF                |
  36. | turbo_cost_threshold            | 0.000000           |
  37. | turbo_enable                    | ON                 |
  38. | turbo_enable_ps_and_sp          | ON                 |
  39. | turbo_enable_rollback           | OFF                |
  40. | turbo_enable_warning            | ON                 |
  41. | turbo_exec                      |                    |
  42. | turbo_index_range               | ON                 |
  43. | turbo_max_temp_directory_size   | 1073741824         |
  44. | turbo_memory_limit              | 268435456          |
  45. | turbo_parallel_read_buffer_size | 2097152            |
  46. | turbo_release_retries           | 600                |
  47. | turbo_retry_pause               | 1000               |
  48. | turbo_skip_charset_check        | OFF                |
  49. | turbo_temp_directory            | duckdb_dp.data.tmp |
  50. | turbo_worker_threads            | 4                  |
  51. +---------------------------------+--------------------+
  52. 17 rows in set (0.00 sec)
复制代码

查看error log

  1. [root@anolis8 log]# tail /var/log/mysqld.log
  2. Turbo scan
  3.     -> Table scan on t1, column(id)  (cost=0.3, row=3) (actual time=1085.682 rows=3 loops=1)



  4. Turbo scan
  5.     -> Table scan on t1, column(id)  (cost=0.3, row=3) (actual time=4.887 rows=3 loops=1)



复制代码


这不符合预期吧?



全部回复(3)
ShawnYan 5 天前
warn 参数关掉也报

  1. mysql> set turbo_enable_warning = off;
  2. Query OK, 0 rows affected (0.00 sec)

  3. mysql> EXPLAIN analyze SELECT /*+ SET_VAR(turbo_enable=ON) SET_VAR(turbo_cost_threshold=0) */ * FROM mydbt.t1;
  4. +------------------------------------------------------------------------------------------------------------+
  5. | EXPLAIN                                                                                                    |
  6. +------------------------------------------------------------------------------------------------------------+
  7. | -> Turbo scan
  8.     -> Table scan on t1, column(id)  (cost=0.3, row=3) (actual time=11.060 rows=3 loops=1)

  9. |
  10. +------------------------------------------------------------------------------------------------------------+
  11. 1 row in set (0.03 sec)
复制代码


error log
  1. Turbo scan
  2.     -> Table scan on t1, column(id)  (cost=0.3, row=3) (actual time=11.060 rows=3 loops=1)
复制代码
yejr 5 天前
ShawnYan 发表于 2025-4-17 12:57
warn 参数关掉也报

经验证,结果的确如此,谢谢严老师的报告,我们会作为issue提交
reddey 前天 14:26
ShawnYan 发表于 2025-4-17 12:57
warn 参数关掉也报

优秀
一个学艺不精的国产数据库爱好者
ShawnYan

23

主题

2

博客

907

贡献

版主

Rank: 7Rank: 7Rank: 7

金币
14728
贡献
907

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2025-4-22 05:25 , Processed in 0.021518 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表