-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Select statement run too slow #5896
Comments
@leonchen83 @winoros PTAL |
@leonchen83 tidb master branch is much faster than release1.0, please have a try. |
@zz-jason |
We're preparing Stream Aggregation in #5725 . This feature will speed up this sql a lot. |
@leonchen83 can you show us the execution plan in mysql by running the following sql in mysql: |
maybe the |
@leonchen83 Yes, It's related to this optimization: https://dev.mysql.com/doc/refman/5.7/en/group-by-optimization.html, which tidb is not supported yet. |
@zz-jason |
@leonchen83 INDEX_02 won't take effect until the stream aggregation feature is ready. |
@winoros can Stream Aggregation speed up the query as fast as mysql(0.35sec, tidb 1.5 min)? |
@leonchen83 Whether use index or not, TiDB always examine 130,000,000 rows data for now. When "Loose Index Scan" is supported, rows examined by TiDB can be reduced the same as MySQL and may have the same speed compared to MySQL. |
@zz-jason |
@leonchen83 1.1.0 won't support |
another question releated this issue. I m adding another index
|
@zimulala PTAL |
@leonchen83 |
tidb config: |
@leonchen83 |
the log is very big and like following
|
@leonchen83 |
@zimulala after killed
and then I found that create index still running in backend when I check
How should I terminate that create index process? |
@leonchen83 |
@leonchen83 create index slow was fixed by PR: #5964 , you can try the newest master branch. |
@leonchen83 Feel free to reopen this issue if you still have any problem. |
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
step 1:
step 2:
insert into this table 130,000,000rows data.
step 3:
execute
select BK_SYMBOL_ID, max(QUOTE_TIME) as QUOTE_TIME from BK_QUOTE group by BK_SYMBOL_ID
found that this query is too slow.
the explain sql is following:
explain select BK_SYMBOL_ID, max(QUOTE_TIME) as QUOTE_TIME from BK_QUOTE group by BK_SYMBOL_ID
As fast as Mysql (0.35 sec)
execute this query more than 1 min.
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: