I am writing a simple Java app to run weekly. The app need call database to get data, check it and update.
The flow I need is little as following:
select configure,orgID where status=true from orgs;orgshas thousands of rowrows,configureis blob
- Check blob object configure, and filtered the orgID
orgIDlist - for filtered orgID
orgIDlist,select * from users where status=true and orgID in (orglist)usersis a huge table. for eachorgID, there can be as much as 400k users.
- for users information, we update one column of all these users
I have couple questions:
when we select
configurethis field is blob and it can be as large as 1k. Is it good practice to get thousands of rows at one time? or it is better to make multiple db call? time and space, which is more important?users table has millions rows, we need update perhaps 1 column for 1 million rows. what is a good practice to make this update? is it better to make 1 million db call? or as little db calls as possible?