Fork me on GitHub
#sql
<
2017-11-20
>
jonpither16:11:32

Hi - have a clojure.jdbc query. We are using result-set-seq, and for a particular query it becomes very slow going trying to move past the next fetch-size of results. We tried to set the timeout opt, but I suspect this only impacts the initial query, not the scrolling through of results, is this correct?

seancorfield17:11:13

Can you share some code so we can see how you're setting up the RS and what you're trying to do with it?

jonpither17:11:36

not easily. It's a prepared statement. I'm not keeping hold of the seq head coming from the query, I'm iterating over it in a doseq and feeding the results onto some core.async channel

jonpither17:11:07

result-type: forward-only, :concurrency: read-only

jonpither17:11:22

I'll make a gist 🙂 might be tomorrow. I'll check back then. Thanks 🙂

seancorfield17:11:34

What is :fetch-size set to?

seancorfield17:11:12

(have you tried smaller / larger values to see if makes a difference?)

seancorfield17:11:43

Also, given the setup with a PreparedStatement, have you tried raw Java interop to eliminate java.jdbc itself as a cause?

jonpither17:11:09

it was 1000, but we moved it down to 100 to see if it could help

jonpither17:11:34

we haven't tried raw interop, it's an option - thanks