pingcap/tidb

Loose index scan can be used to speed up DISTINCT upon JOIN

Open

#18,693 创建于 2020年7月20日

在 GitHub 查看
 (12 评论) (0 反应) (1 负责人)Go (6,186 fork)batch import
challenge-programhelp wantedsig/executionsig/planner

仓库指标

Star
 (40,090 star)
PR 合并指标
 (平均合并 14天 4小时) (30 天内合并 346 个 PR)

描述

Description

In issue https://github.com/pingcap/tidb/issues/14460. It proposed a scan method called loose index scan. This method is to scan the index and skip the same value.

In this issue, we describe a scene that is not mentioned in that issue.

Consider query select distinct t2.a from t1, t2 where t1.a=t2.a.

Since we need unique t2.a. So we also don't need t1.a return the same value twice, which means that we can apply a loose index scan on the t1 side.

Score

6600

Mentor

@winoros (Slack ID: Cui Yiding)

#sig-planner

Recommend Skills

  • Golang and Rust

贡献者指南