OK, I see. Thanks for the explanations.

I remember jTDS having been faster in the past. Specifically the
serialisation of binary data was significantly faster if I remember
correctly. On the other hand, with the driver now being MIT licensed and on
Github, there might be some new traction towards a better official driver:
https://github.com/Microsoft/mssql-jdbc

We'll see.

2017-03-09 7:59 GMT+01:00 Marcus Gattinger <[email protected]>:

> Your suggestion is quite interesting. Is that something the developer
> writing the SQL must be aware of or is jOOQ smart enough to apply this
> pattern if the target database is SQL Server (of a version that supports
> it) and the SQL contains large sets of parameters (as in my example)?
>

Hmm, I suggested a few things :) I'm assuming this is about reverting to
temporary tables rather than IN lists.

No, jOOQ doesn't automatically optimise your SQL. In principle, jOOQ is an
expert tool that helps you write exactly the SQL you want on any target
database, so if you **want** to have queries with large IN lists, then jOOQ
won't prevent this from happening.

However, if you're aware of these problems, then jOOQ will help you work
around them as well. For instance, jOOQ 3.9 introduced a feature called IN
list padding (https://github.com/jOOQ/jOOQ/issues/5600) which reduces the
combinatorial complexity of possible SQL strings when doing dynamic SQL by
repeating some values in the IN list in order to have fewer possible SQL
strings.

But it would be unwise to apply this automatically, because padding IN
lists has its own overhead (more bind variables than needed) and you might
not have any problem in production with large IN lists, if you run this
kind of query only periodically.

However, we're thinking about writing a jOOQ lint extension in the future,
that logs messages to some lint log to indicate common mistakes in SQL
queries. Ultimately, our mission is to teach as much as to help.

Lukas

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to