Data import
seekdb allows you to import data from external files into database tables. It provides two methods for data import: server-side import and client-side import. This topic describes how to use these two methods.
Overview
Depending on the location of the data file, seekdb supports the following two main data import methods:
-
Server-side import (recommended): The data file is located in a position accessible to the server (such as the local file system or object storage). The database server directly reads the file for import. This method is suitable for production environments and large-scale imports. Server-side import is based on the FILES() function, and it provides two usage methods:
LOAD DATA FROM FILES()andINSERT INTO ... SELECT FROM FILES(). -
Client-side import: The data file is located on the client side. The client tool reads the file and transmits it to the server. This method is suitable for scenarios where the server and the file location are not connected through a network.
Note
For seekdb, it is recommended to prioritize server-side import. Server-side import offers better performance and does not require client-side configuration. Client-side import is suitable for scenarios where the server cannot directly access the file location.
This topic provides a simple example of how to use the LOAD DATA statement for data import. For more detailed information about the LOAD DATA statement, please refer to the LOAD DATA documentation.
Limitations
Tables with triggers are not supported for LOAD DATA statements.
Considerations
seekdb optimizes data import speed using parallel processing technology. This operation divides data into multiple subtasks for parallel execution, with each subtask treated as an independent transaction. The execution order is not fixed. Therefore:
- Global atomicity of the data import process cannot be guaranteed.
- For tables without a primary key, the data write order may differ from the original file order.