Is there a way to avoid full table scans in TiFlash?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 有办法避免tiflash全表扫描吗?

| username: TiDBer_rYOSh9JN

When performing query operations, the TiFlash table always performs a full table scan. Is there a way to avoid full table scans?

| username: tidb菜鸟一只 | Original post link

TiFlash is a columnar storage database, theoretically, each field is an index, and a full table scan is essentially a full index scan.

| username: Kongdom | Original post link

TiFlash is a columnar storage, which means it performs full table scans and does not use indexes. If you want to use indexes, you need to use TiKV.

| username: Soysauce520 | Original post link

Use hint to specify TiKV execution.

| username: zhanggame1 | Original post link

tilash is not a full table scan; column storage means a full scan of specific columns.

| username: 昵称想不起来了 | Original post link

TiFlash columnar storage does not have the concept of indexes; it performs a full table scan.

For SQL optimization, you can refer to the example provided by the expert:

| username: cassblanca | Original post link

The jump index for TiFlash hasn’t been released yet, right?

| username: 大飞哥online | Original post link

It should be a full column scan performed by TiFlash, while TiKV is a full table scan.

| username: 有猫万事足 | Original post link

You are indeed knowledgeable. I thought columnar storage didn’t need indexes. :sweat_smile:

I checked GitHub, and it seems that the minmax-index might be the only index currently used by TiFlash. However, it appears to automatically apply to integers and dates, so there’s no need to use it intentionally.

| username: Jellybean | Original post link

The full table scan of TiFlash might be different from what you understand. A full table scan in row storage reads all columns of all rows, while in column storage, it reads certain columns of all rows. Therefore, in AP scenarios, the efficiency of column storage can be very high.

| username: cassblanca | Original post link

Regarding various optimization methods for columnar storage, refer to the Russian ClickHouse. It is really simple, straightforward, and surprisingly effective, but very useful.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.