February 14, 2020 - 7:21 pm UTC
Thanks Chrish for quick response.
Below are the details why I'm doing index rebuild...
I have 4 main source tables which are big tables and every day I will have millions updates from any of the table. It will update historically for 30 derivation columns in main table. These updates are aggregate updates.
For example product -111 has effective from 201001 to 202001 and if 202002 day, if 111 product effective dates are changing/split then I have to update the min and max dates in main table. Like this I have 10 columns which will change.
So, to avoid update Im picking the changed records from 4 source tables and calculating aggregations and inserting into into temp table and copying the rest of the data again back to temp table from main table. After that doing rebuild index and partition exchange.
Please suggest is there any way I can avoid updates or improve performance?
Appreciate your help.
February 18, 2020 - 10:43 am UTC
I still see no reason to rebuild indexes based on what you've said. Skipping this step will save you however long that takes.So, to avoid update ... any way I can avoid updates
I'm confused - are you running any updates or not?
To help, we need a worked example:
- create tables
- insert into
- the process you're running
- a description of why you're doing this