-
Notifications
You must be signed in to change notification settings - Fork 264
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]: select limit1 query need to be scan 1 millions row and cost more than 1 senconds #15457
Comments
已经在多cn环境下验证成功修复 这个问题的关键是,多cn,然后select语句带filter。 |
mysql> select count() from t1; mysql> show backend servers; mysql> explain analyze select * from t1 where c2!=1 limit 1; |
testing |
fixed: 275af9c |
Is there an existing issue for the same bug?
Branch Name
1.1-dev
Commit ID
55eb0f9
Other Environment Information
Actual Behavior
select * from statement_info limit 1 , cost more than 1 sencond:
mysql> select * from statement_info limit 1;
+--------------------------------------+--------------------------------------+--------------------------------------+-----------+-------+----------------+----------+-----------+---------------+-----------------------+--------------------------------------+-----------+----------------------------+----------------------------+----------+---------+----------+-------+--------------------------------------------------------------------------------------------------------------------+-----------+------------+---------------------------+----------------+------------+---------+-----------------+------------+--------------+
| statement_id | transaction_id | session_id | account | user | host | database | statement | statement_tag | statement_fingerprint | node_uuid | node_type | request_at | response_at | duration | status | err_code | error | exec_plan | rows_read | bytes_scan | stats | statement_type | query_type | role_id | sql_source_type | aggr_count | result_count |
+--------------------------------------+--------------------------------------+--------------------------------------+-----------+-------+----------------+----------+-----------+---------------+-----------------------+--------------------------------------+-----------+----------------------------+----------------------------+----------+---------+----------+-------+--------------------------------------------------------------------------------------------------------------------+-----------+------------+---------------------------+----------------+------------+---------+-----------------+------------+--------------+
| 018ecab4-2555-7bde-8a0d-00334a53c4a5 | 018ecab4-17b1-7f23-ad35-0a25001f9ed0 | 018ec911-a405-70db-a259-ce4dc831b075 | tpcc_test | admin | 10.10.3.0:8775 | tpcc_10 | commit | | | 62313066-3865-3331-6235-626563653038 | CN | 2024-04-11 01:09:47.477001 | 2024-04-11 01:09:47.571643 | 94642146 | Success | 0 | | {"code":200,"message":"NO ExecPlan Serialize function","steps":null,"uuid":"018ecab4-2555-7bde-8a0d-00334a53c4a5"} | 0 | 0 | [4,0,0,0,0,12,0,2,0.0094] | Commit | TCL | 2 | external_sql | 0 | 0 |
+--------------------------------------+--------------------------------------+--------------------------------------+-----------+-------+----------------+----------+-----------+---------------+-----------------------+--------------------------------------+-----------+----------------------------+----------------------------+----------+---------+----------+-------+--------------------------------------------------------------------------------------------------------------------+-----------+------------+---------------------------+----------------+------------+---------+-----------------+------------+--------------+
1 row in set (1.27 sec)
explain analyze :
mysql> explain analyze select * from statement_info limit 1;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| QUERY PLAN |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Project |
| Analyze: timeConsumed=0ms waitTime=892ms inputRows=1 outputRows=1 InputSize=362548bytes OutputSize=362548bytes MemorySize=362548bytes |
| -> Table Scan on system.statement_info |
| Analyze: timeConsumed=96900ms scan_time=[total=96291ms,min=64ms,max=830ms,dop=162] filter_time=[total=585ms,min=0ms,max=90ms,dop=162] waitTime=2756ms inputRows=1265819 outputRows=1 InputSize=2208mb OutputSize=362548bytes MemorySize=3894mb |
| Filter Cond: (statement_info.account = 'tpcc_test') |
| Block Filter Cond: (statement_info.account = 'tpcc_test') |
| Limit: 1 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 rows in set (0.91 sec)
and the count of table:
mysql> select count() from statement_info;
+----------+
| count() |
+----------+
| 642617 |
+----------+
1 row in set (0.15 sec)
Expected Behavior
No response
Steps to Reproduce
Additional information
No response
The text was updated successfully, but these errors were encountered: