Mysql query speed slow, cause offset

this is my config file:
`
input {
jdbc {
jdbc_driver_library => "/tmp/logstash/logstash-7.9.3/mysql/mysql-connector-java-8.0.16.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
jdbc_page_size => 3
tracking_column => "id"
use_column_value => true

record_last_run => true

jdbc_connection_string => "jdbc:mysql://192.168.50.254:33066/kuzi?serverTimezone=Asia/Shanghai&useCursorFetch=true"
    jdbc_fetch_size => 5
jdbc_user => cc
jdbc_password => cccc
jdbc_paging_enabled => true
tracking_column_type => "numeric"

schedule => "0 0 0 1/1 * ?"

statement => "SELECT * from qq_copy1 where id > :sql_last_value "

}
}

output {

stdout { codec => "rubydebug"}

elasticsearch {
index => "qqq"
hosts => ["127.0.0.1:9200"]
document_id => "%{id}"
}
}
`
I hope query order is
select * from (select * from qq_qqcopy1 where id > 0) limit 3 offset 0
select * from (select * from qq_qqcopy1 where id > 3) limit 3 offset 0
select * from (select * from qq_qqcopy1 where id > 6) limit 3 offset 0
use this query mode.

i have mass data, if statement is 'SELECT * from qq_copy1', query speed very slow. so help please

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