All Products
Search
Document Center

PolarDB:Fast Import

Last Updated:May 13, 2025

PolarDB for MySQL provides the Fast Import feature to query the full data of databases and tables in a restoration task after waiting for approximately 5 to 10 minutes (independent of the data size to be restored) after you submit a restoring database or table task, instead of waiting for the restoration task to complete.

Scenarios

Note

The Fast Import feature is compatible with the new database and table restoration process, allowing query operations to be performed simultaneously with the restoration task.

The Fast Import feature can be used for acceleration in the following two scenarios:

  • When data or tables are accidentally deleted and the specific point in time cannot be determined, traditional restoration tasks may take a long time to complete. With the Fast Import feature, you can quickly query and verify data without waiting for the restoration task to complete.

  • When a small amount of data is accidentally deleted but the table is large, the Fast Import feature allows you to quickly obtain the required data from the table in the restoration task using INSERT ... SELECT ... and insert it into the table with the accidentally deleted data, thereby improving the efficiency.

Supported versions

Your cluster must run MySQL 8.0.1 with the revision version 8.0.1.1.49 or later. You can check your cluster revision version as specified in Query the engine version.

Precautions

Note

This feature is in the canary release phase. To use this feature, you can contact us.

  • Only file-per-table configuration (default) is supported: You can query data only in tables that are not compressed or encrypted during the execution of restoration tasks.

  • When the number of tables in the restoration task is less than 1000, the Fast Import feature is enabled by default, allowing you to query the full data during the restoration process.

    Note

    When the number of restoration tasks exceeds 1000, the Fast Import feature is not enabled. The task management flow will automatically determine whether to enable the Fast Import feature based on your current task submission.

  • Query operations are only supported on primary nodes and read-only nodes. If column store read-only nodes exist, you can use the hints to force route query requests to primary nodes or row store read-only nodes. Otherwise, no data is returned.

  • When buffer pool resources are sufficient, accessing a table which is being restored delivers a comparable efficiency to normal tables. However, if the cluster has high workloads, the efficiency of accessing a table which is being restored is limited to reduce the impact on normal business operations.

  • Before the restoration task is completed, the table can only be accessed in read-only mode.

Usage notes

Submit database and table restoration tasks

After submitting a database and table restoration task, you can access the task details page by clicking the details link in the upper right corner of the page.

image

On the task details page, you can see the real-time progress of the task. After Step 4 is completed, you can confirm that the database or table has been created in the restoration task by executing statements such as show databases or show tables. Then, you can query the full data of the database or table.

image

Fast read-only access

You can query the information_schema.fast_import_tablespaces table to obtain information about all tables that support fast read-only access in the current restoration task.

Note

You can perform fast read-only access to the tables that have data being imported, but specific table names will not be displayed in the query results. You can execute the SHOW PROCESSLIST command to view SQL statements containing dbms_rman.import to obtain the names of tables that are being restored.

SELECT * FROM information_schema.fast_import_tablespaces;

Figure 1. You can have read-only access to full data of the tables that are being restored.

image

Figure 2. You can have read-only access to full data of other tables that have fast access enabled.

image.png

FAQ

Why no data is returned when I query a table that is being restored?

Ensure that the step to restore databases and tables on the primary node is completed in the current task and meets the following conditions:

  • The table information exists in the information_schema.fast_import_tablespaces table.

  • Or the SQL statement containing dbms_rman.import is being executed and meets the conditions in Precautions.

What are the impacts when you query a large table that is being restored?

The Fast Import feature is mainly used for quick verification and data restoration. Note the following points when you use the feature:

  • Querying tables that are being restored has equivalent impacts on the cluster to querying normal tables with the same data volume.

  • We recommend that you do not perform continuous, long-term, large-scale queries on tables that are being restored.

Why are error returned when you perform update operations on the table that is being restored?

Tables in the information_schema.fast_import_tablespaces table and tables that have SQL statement containing dbms_rman.import being executed are being restored or are about to be restored. These tables only allow read-only access and do not support update or alter operations.

image

Contact us

If you have any questions about the Fast Import feature, you can join DingTalk Group 28000021116. You can directly talk to experts in the group and raise your questions. In addition, PolarDB for MySQL Assistant can answer your questions in a 24/7 manner.