-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Labels
Description
I have prepared following logstash config
input {
jdbc {
jdbc_driver_library => "mysql-connector-java-5.1.39-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://dbhost:3306/mydb"
jdbc_user => "user"
jdbc_password => "password"
statement => "SELECT * FROM test"
jdbc_paging_enabled => "true"
jdbc_page_size => "10000"
}
}
output {
stdout { codec => json_lines }
}
When I run logstash and check SHOW PROCESSLIST;
on my db, I see following sql statements:
SELECT * FROM (SELECT * FROM test) as j LIMIT 10000 OFFSET 10000
This query reads all rows from table on each page (a few milions rows in my case) so this paging strategy is not optimal. It should do queries presented below.
SELECT * FROM test LIMIT 10000 OFFSET 10000
Redithion, antonyoneill, gtt116, narmontas, mcos and 8 more