lt_group_executor — use to execute grouped sql file in parallel
java -jar lt_group_executor.jar
[url
] [username
] [password
] [filePath
]
A batch of SQL divided into groups defined in text file. The SQL of the same group is executed sequentially in the same thread, and different groups are executed concurrently.
mainly for used combined with lightdb lt_dump, replace the lt_restore in doing import ddl part in performance concerned circumstances.
File format is ${group},${sql}
pre line, use ','
to separate group and sql, sql can not contain character '"'
.
Here is a simple example file:
group1, create table test(v int) group1, insert into test(v) values(1) group2, create table test2(v int) group2, insert into test2(v) values(1)
TODO: future version will support lt_dump -pre-data's output format directly.
lt_group_executor accepts the following command-line arguments:
url
JDBC connection string for target database.
username
username for login.
password
passord for login.
filePath
sql file to execute .
The parallel count is the same as the number of CPU cores on the machine
where lt_group_executor.jar
running.
$
java -jar lt_group_executor.jar \ "jdbc:postgresql://localhost:5432/postgres" "lightdb" "123" t.sql