What does UnionScan in TiDB mean?

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

Original topic: explain 中的UnionScan 代表什么意思?

| username: Raymond

May I ask what exactly UnionScan in explain represents? The official documentation doesn’t mention it.

| username: h5n1 | Original post link

When dealing with partitioned tables, it represents the merging of results from multiple partitions, and it is also used during index merge. Is your table a partitioned table?

| username: Raymond | Original post link

Sorry, I forgot to include the table structure. It is not a partitioned table.

| username: h5n1 | Original post link

| username: OnTheRoad | Original post link

Memory cache tables will also use union scan.

| username: OnTheRoad | Original post link

In version 6.0, when small table caching is enabled, reading data from the cached table will also use UnionScan. For more details, see the link “Verify if it is a cached table”.

| username: Raymond | Original post link

Thank you for sharing the article, bro. The reason why it shows unionscan is because I turned off autocommit, the data was not written to TiKV, and there is dirty data in the TiDB server memory, which is why this happens.

| username: system | Original post link

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