Hi,
I want to implement AFTER INSERT trigger, and trying to assess the expected impact on performance (naturally I'll test it too, currently trying to get a head start on expected issues).
here's a brief description of the overall environment:
- i have a partitioned table (Fact table in DWH), whenever new data arrives it's inserted to a different table (i call is Swap table), and once insert is done the new partition on the Swap table is switched in to the production Fact table
- an insert can contain from 1 to 10 million rows
- the insert runs automatically by SSIS, and also the switching (ssis firing stored procs)
the requirement :
- whenever new data arrives, i need to register the dates that were in included in the new data, and write them to a side table
- so for example if 1 million rows we written to the Swap table, i'd like the trigger to perform a SELECT DISTINCT date FROM inserted, and write it to the side table (usually not more than 10 days will be retrieved by the SELECT DISTINCT)
My questions:
- if i create the after insert trigger - does this mean that every inserted row (to the Swap table) will now be written twice? once to the Swap table and then to INSERTED table for the trigger to use?
- say the trigger was fired, and before it finished it's operation the SSIS is attempting to perform the switching (leaving the Swap table on which the trigger runs empty) - will the trigger interrupt the switching?
- say the trigger was fired and before it's dome reading from the inserted table, and a new INSERT operation should start on the Swap (by ssis) - will the two processes interfere ?
thanks :)