We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
use index()
Please answer these questions before submitting your issue. Thanks!
mysql> create table t(a int, b int primary key, index idx_a(a)); Query OK, 0 rows affected (0.03 sec) mysql> explain select a from t use index();
mysql> explain select a from t use index(); +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+ | 1 | SIMPLE | t | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | NULL | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+ 1 row in set, 1 warning (0.00 sec) mysql> explain select a from t; +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+-------------+ | 1 | SIMPLE | t | NULL | index | NULL | idx_a | 5 | NULL | 1 | 100.00 | Using index | +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+-------------+ 1 row in set, 1 warning (0.01 sec)
mysql> explain select a from t use index(); +-------------------+----------+------+---------------------------------------------------------------------+ | id | count | task | operator info | +-------------------+----------+------+---------------------------------------------------------------------+ | IndexReader_7 | 10000.00 | root | index:IndexScan_6 | | └─IndexScan_6 | 10000.00 | cop | table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo | +-------------------+----------+------+---------------------------------------------------------------------+
tidb-server -V
select tidb_version();
mysql> select tidb_version(); +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tidb_version() | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Release Version: v4.0.0-alpha-198-g8810a9c Git Commit Hash: 8810a9c167ad71c9a51e82e2a0411405d1862512 Git Branch: improve_skylineprune UTC Build Time: 2019-09-04 10:23:18 GoVersion: go version go1.12.7 linux/amd64 Race Enabled: false TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 Check Table Before Drop: false | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
The text was updated successfully, but these errors were encountered:
francis0407
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
In MySQL, the query above chooses TableScan.
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: