How to read all rows from huge table?

前端 未结 6 1505
长发绾君心
长发绾君心 2020-11-28 03:11

I have a problem with processing all rows from database (PostgreSQL). I get an error: org.postgresql.util.PSQLException: Ran out of memory retrieving query results.

6条回答
  •  忘掉有多难
    2020-11-28 03:31

    Use a CURSOR in PostgreSQL or let the JDBC-driver handle this for you.

    LIMIT and OFFSET will get slow when handling large datasets.

提交回复
热议问题