Hi Kevin, The main differences are:
- jOOQ uses bind values by default, not inline values. There might be edge cases where this bothers optimisers - jOOQ fetches all results in memory eagerly by default. JDBC (and JDBC based UIs) are lazy, fetching only a few records Other than that, I'd have to see example code. I hope this helps Lukas On Thu, Sep 12, 2024 at 6:37 PM Kevin Jones <[email protected]> wrote: > I'm not sure if this is a stupid question. > > I have an application that uses JOOQ. It's a desktop app written in Kotlin > using SQLite as the database with a lot of fairly complex queries. Within > the app one of the queries takes about 11 seconds to run. If I take the > generated SQL for that query and run it from an IDE against the same SQLite > database it takes ~1.2 seconds to run. (The IDE is Jetbrains DataGrip and > it's using JDBC under the covers) > > I'm using the same version of the JDBC driver in both cases, I'm not using > a connection pool in the Kotlin app > > This started out because the JOOQ I had written was taking too long, so I > grabbed the SQL and managed to find the issue. I could fix the issue in one > of two ways, the fixes are equivalent and both reduce the query time to > ~1.2 seconds. > > If I apply either of those two fixes to the JOOQ code then the fix appears > in the generated SQL *but* the query still takes about 11 seconds. > > Does JOOQ pass the generated SQL straight to the DB or is something else > going on? > > -- > Kevin Jones > KnowledgeSpike > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/CAKT%3DYsMqavAf%3D9OTU-YcNQ9hOVxQKrAU2U3oNZxw4BJ0JR594A%40mail.gmail.com > <https://groups.google.com/d/msgid/jooq-user/CAKT%3DYsMqavAf%3D9OTU-YcNQ9hOVxQKrAU2U3oNZxw4BJ0JR594A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO6US2TXCKTfpxSVqmfbGenEsSW2QBRft0RRnbVsPdk6sg%40mail.gmail.com.
