Why does Microsoft SQL Server 2012 query take minutes over JDBC 4.0 but second(s) in Management Studio?

后端 未结 4 1757
南旧
南旧 2020-12-17 19:32

I am dealing with what is apparently a performance issue while retrieving a relatively large

4条回答
  •  情歌与酒
    2020-12-17 19:37

    I'm simply going to toss out this suggestion, and leave it for you to test.

    The JDBC driver may well be FETCHING all of the rows before it returns, whereas the other system is simply returning the open cursor.

    I have seen this behavior on other databases with JDBC, but had not direct experience with SQL Server.

    In the examples where I have seen it, setting the auto commit to false for the connection prevents it from loading the entire result set. There are other settings to have it load only portions, etc.

    But that could well be the underlying issue you are facing.

提交回复
热议问题