Skip to content

use_index_merge hint does not take effect for MV index #50553

@seiya-annie

Description

@seiya-annie

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

explain SELECT /*+ use_index_merge(items, feed_profile_ids), IGNORE_PLAN_CACHE() */
  *
FROM
  items
WHERE
  57260686 member of (feed_profile_ids)
  AND "OC8p1763XTk" member of (normalized_short_link_clusters)
  AND json_overlaps(
    product_sources,
    '["M1","M2","M3"]'
  )
LIMIT
  100 ;

2. What did you expect to see? (Required)

use feed_profile_ids index

3. What did you see instead (Required)

use normalized_short_link_clusters index

+------------------------------------+---------+-----------+--------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id                                 | estRows | task      | access object                                                                                                                        | operator info                                                                                                                                                              |
+------------------------------------+---------+-----------+--------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Limit_10                           | 0.00    | root      |                                                                                                                                      | offset:0, count:1                                                                                                                                                          |
| └─Selection_11                 | 0.00    | root      |                                                                                                                                      | json_overlaps(test.items.product_sources, cast("["M1","M2","M3"]", json BINARY))                                                         |
|   └─IndexMerge_18              | 0.00    | root      |                                                                                                                                      | type: union                                                                                                                                                                |
|     ├─IndexRangeScan_15(Build) | 10.85   | cop[tikv] | table:items, index:normalized_short_link_clusters(cast(`normalized_short_link_clusters` as char(1000) array), point_of_sale_country) | range:["OC8p1763XTkt","OC8p1763XTkt"], keep order:false, stats:partial[normalized_short_link_clusters:unInitialized, feed_profile_ids:unInitialized] |
|     └─Selection_17(Probe)      | 0.00    | cop[tikv] |                                                                                                                                      | json_memberof(cast(57260686, json BINARY), test.items.feed_profile_ids)                                                                                                    |
|       └─TableRowIDScan_16      | 10.85   | cop[tikv] | table:items                                                                                                                          | keep order:false, stats:partial[normalized_short_link_clusters:unInitialized, feed_profile_ids:unInitialized]                                                              |
+------------------------------------+---------+-----------+--------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 rows in set, 9 warnings (0.00 sec)

4. What is your TiDB version? (Required)

7.6.0-pre 42960c3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions