Closed okou19900722 closed 1 year ago
128
is the default limit of fetch in vertx-jdbc-client
In the driver itself, there is no such concept of FETCH_SIZE
. Instead, all results are read to memory before future completes (or callback is called). So the parameter has no real effect as far as I know.
but it will block the event loop
do you mean that user code will block the event loop?
one million row will fetch in a loop, it's will block the event loop. I can only manually pause, and wait for 1 millisecond before resume
Another alternative is to schedule it later (manually) with delay. However, I am not sure there is an actual performance impact on blocking the event loop with cpu bound work. Usually, servers are io bound and not cpu bound and the pool of threads for events loop is of the size of the number of cores.
if you are using Postgres have you tried using the Reactive PG Client that provides a similar concept using cursor ?
I'm working with mysql. Looking forward to vertx-sql-client
https://github.com/vert-x3/vertx-mysql-postgresql-client/blob/cbdbf729ad327834211140112b7958807a449650/vertx-mysql-postgresql-client-jasync/src/main/java/io/vertx/ext/asyncsql/impl/AsyncSQLRowStream.java#L69-L74
https://github.com/vert-x3/vertx-mysql-postgresql-client/blob/cbdbf729ad327834211140112b7958807a449650/vertx-mysql-postgresql-client-jasync/src/main/java/io/vertx/ext/asyncsql/impl/AsyncSQLRowStream.java#L93-L96
it will fetch all the result and never pause until it's finish