Multi threading database reading

后端 未结 3 553
星月不相逢
星月不相逢 2021-02-04 22:16

In our Java application I have requirement to read the around 80 million records from oracle database. I am trying to redesign the multithreading program for this. Currently we

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 22:28

    As noted in the comments, multithreading might not help and may even make matters worse.

    Standard alternatives for any query are:

    1. See what the query plan is and see if rejigging the SQL can improve the query plan.
    2. Do more processing on the database side - but since you are doing a SELECT COUNT... there is nothing more you can do here!
    3. See if you can rework the query to do incremental computation based on new or updated rows since the last run, instead of querying over all old the data every time.

    None of these are guaranteed to succeed. It would depend on what you are trying to do.

提交回复
热议问题