All Products
Search
Document Center

PolarDB:Fast Import

Last Updated:Aug 31, 2026

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

Scenario overview

Note

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

The Fast Import feature can accelerate 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 use INSERT ... SELECT ... to quickly extract the required data from the tables in the restoration task and insert it into the table where data was accidentally deleted, thereby improving operational efficiency.

Version requirements

The applicable database engine version is MySQL 8.0.1, and the minor version must be 8.0.1.1.49 or later. You can confirm your cluster version by querying the version number.

Precautions

Note

This feature is currently in the canary release phase. To use this feature, you can Contact usjoin the whitelist to enable it.

  • Only the file-per-table configuration (default configuration) is supported for non-compressed and non-encrypted tables. Data can be queried during the execution of restoration tasks.

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

    Note

    When the number of restoration tasks exceeds 1,000, the system does not enable the Fast Import feature. The task management flow automatically determines whether to enable the Fast Import feature based on the task you submit.

  • Query operations are only supported on read/write (RW) nodes and read-only (RO) nodes. If column store read-only (RO) nodes exist, you can use the HINT syntax to force route queries to read/write (RW) or row store read-only (RO) nodes. Otherwise, no data may be returned.

  • When buffer pool resources are sufficient, accessing tables in restoration state delivers comparable efficiency to accessing normal tables. However, in scenarios where the cluster has high workloads, the efficiency of accessing tables in restoration state is limited to reduce the impact on normal business operations.

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

Usage instructions

Submit a database and table restoration task

After submitting a database and table restoration task, you can go to the task details page through the details link in the upper-right corner of the page.

A database and table restoration task consists of 6 steps:

  1. Initialize the task

  2. Full restoration on the temporary node

  3. Incremental restoration on the temporary node (as needed)

  4. Database and table restoration preprocessing

  5. Database and table restoration

  6. Complete the task and reclaim resources

On the task details page, you can view the real-time progress of the task. After Step 4 is completed, you can confirm that the restoration task has created the target databases or tables by executing statements such as show databases or show tables. At this point, you can query the full data of the target databases or tables.

Read-only fast 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

Tables that are currently being imported can be accessed in fast read-only mode, but specific table names are not displayed in the following 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 currently being restored.

SELECT * FROM information_schema.fast_import_tablespaces;
  • Tables in restoration state can be accessed in read-only mode with full data.

    | 106 | root      | 127.0.0.1:49055 | NULL               | Sleep          |  13 |                        | NULL                                                                    |
    | 146 | xxx       | xxx             | NULL               | Sleep          |  43 |                        | NULL                                                                    |
    | 366 | xxx       | xxx             | NULL               | Polar Log Dump |   0 | Reading log from innodb | NULL                                                                    |
    | 368 | xxx       | xxx             | NULL               | Polar Log Ack  |   0 | Receiving from client  | NULL                                                                    |
    | 788 | xxx       | xxx             | NULL               | Sleep          | 295 |                        | NULL                                                                    |
    | xxx | xxx       | xxx             | NULL               | Query          | 332 | altering table         | /* rds internal mark */ call dbms_rman.import('test', 'sbtest1_bk03211652' |
    | 216448 | xxx    | xxx             | information_schema | Sleep          |   7 |                        | NULL                                                                    |
    | 216915 | xxx    | xxx             | NULL               | Sleep          |   0 |                        | NULL                                                                    |
    | 216916 | xxx    | xxx             | NULL               | Sleep          |   0 |                        | NULL                                                                    |
    | 536879884 | xxx |                 | test               | Query          |   0 | starting               | show processlist                                                        |
    
    31 rows in set (0.00 sec)
    
    mysql> show tables;
    +----------------------+
    | Tables_in_test       |
    +----------------------+
    | sbtest1              |
    | sbtest1_bk03211652   |
    | sbtest2              |
    | sbtest2_bk03211652   |
    +----------------------+
    4 rows in set (0.00 sec)
    
    mysql> select count(*) from sbtest1;
    +-----------+
    | count(*)  |
    +-----------+
    | 100000000 |
    +-----------+
    1 row in set (4.64 sec)
    
    mysql> select count(*) from sbtest1_bk03211652;
    +-----------+
    | count(*)  |
    +-----------+
    | 100000000 |
    +-----------+
    1 row in set (48.21 sec)
  • Other tables with fast access enabled can be accessed in read-only mode with full data.

    mysql> select * from information_schema.fast_import_tablespaces;
    +----------------+-------------------------+------------------------------------------------------------------+
    | LOCAL_SPACE_ID | SPACE_NAME              | REMOTE_DATA_PATH                                                 |
    +----------------+-------------------------+------------------------------------------------------------------+
    |             18 | test/sbtest2_bk03211652 | xxx/test/sbtest2_bk03211652.ibd                                  |
    +----------------+-------------------------+------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> show tables;
    +------------------------+
    | Tables_in_test         |
    +------------------------+
    | sbtest1                |
    | sbtest1_bk03211652     |
    | sbtest2                |
    | sbtest2_bk03211652     |
    +------------------------+
    4 rows in set (0.00 sec)
    
    mysql> select count(*) from sbtest2_bk03211652;
    +----------+
    | count(*) |
    +----------+
    |     1000 |
    +----------+
    1 row in set (0.00 sec)
    
    mysql> select count(*) from sbtest2;
    +----------+
    | count(*) |
    +----------+
    |     1000 |
    +----------+
    1 row in set (0.00 sec)
    
    mysql> select count(*) from sbtest1;
    +-----------+
    | count(*)  |
    +-----------+
    | 100000000 |
    +-----------+
    1 row in set (19.39 sec)
    
    mysql> select count(*) from sbtest1_bk03211652;
    +-----------+
    | count(*)  |
    +-----------+
    | 100000000 |
    +-----------+
    1 row in set (4.39 sec)
    
    mysql> show processlist;

FAQ

Why is the data in the target table for restoration empty?

Make sure that the current task has reached the "Database and table restoration on the primary node" step and meets the following conditions:

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

  • Or the dbms_rman.import SQL operation is being executed and meets the conditions described in Precautions.

If the table data volume is very large, are there other impacts when querying tables in restoration status?

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

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

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

Why do I get an error when performing update operations on the target table for restoration?

Tables listed in the information_schema.fast_import_tablespaces list and tables for which the dbms_rman.import SQL operation is being executed are currently being restored or are about to be restored. These tables only allow read-only access and do not support any update or modification operations.

mysql> select * from information_schema.fast_import_tablespaces;
+----------------+-------------------------+-----------------------------------------------------------+
| LOCAL_SPACE_ID | SPACE_NAME              | REMOTE_DATA_PATH                                          |
+----------------+-------------------------+-----------------------------------------------------------+
|             24 | test/sbtest2_bk03211708 | xxx/test/sbtest2_bk03211708.ibd                           |
+----------------+-------------------------+-----------------------------------------------------------+
1 row in set (0.00 sec)

mysql> delete from sbtest2_bk03211708 limit 10;
ERROR 1288 (HY000): The target table sbtest2_bk03211708 of the DELETE is not updatable
mysql>