bulk update
-
Hi. I need advice on a manner; There are lots of items, that I must count for user hits on them. I use mssql to handle item and hit data. There is need to update hit value on time. There for best performance which way is the best? Or could you give a better advice? 1. make an global array in application state and gather hit values for items in this array. When the array total hit count reaches to a big value (for ex: 10000 hits counted). Make update to all items hit field in the database with; (1.a) with a loop over hit array (1.b) write a sql text file and triger mssql to execute this sql command file. 2. update item hit value on every hit item_table
id | hit ----------- 1 | 54 2 | 48 3 | 13 4 | 80 . . .
thanxkaranba
-
Hi. I need advice on a manner; There are lots of items, that I must count for user hits on them. I use mssql to handle item and hit data. There is need to update hit value on time. There for best performance which way is the best? Or could you give a better advice? 1. make an global array in application state and gather hit values for items in this array. When the array total hit count reaches to a big value (for ex: 10000 hits counted). Make update to all items hit field in the database with; (1.a) with a loop over hit array (1.b) write a sql text file and triger mssql to execute this sql command file. 2. update item hit value on every hit item_table
id | hit ----------- 1 | 54 2 | 48 3 | 13 4 | 80 . . .
thanxkaranba