-
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
very slow on an empty table from delete from xx
#52905
Comments
the cause is after GC, the kv is not compacted, so it's still scanned, but skipped, see for tidb_ddl_job, we will insert and delete after process, if we have a lot of ddl, such as create 1M tables, query from it will be slow even it's almost empty.
|
we can use tikv ctl to compact manually, after that there's no delete_skipped_count we need compact default and write cf together in this case
|
maybe related to tikv/tikv#17269 |
seems it's fixed in TiKV master. When I just DELETE the table data
wait some times
The I'll leave this issue open to remind us revert |
tidb have copr cache enabled on default, you need query with a different predicate, such as |
that also depends on how fast TiKV can detect and compact them, users might run many general DDLs in some short time window |
I insert and delete few rows to invalid the cache. You can see |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
tiup playground
60ms
. also test another table with524288
rows, then empty it withdelete from
, it takes440ms
to query it.2. What did you expect to see? (Required)
very fast to query
3. What did you see instead (Required)
slow compared to a new created empty table
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: