Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I have a project where I get responses from emails that are sent out which may be 100 per second. Eventually I have to insert the information received into a table that will have many indexed columns for reporting purposes. My thought was to set up a primary table which is completely stripped any indexes and the responses coming in will be recorded there. In a different process, these records from this first primary table will be moved to the final table with the indexes in an orderly fashion.

- Does anyone have any suggestions on this method or have seen a more efficient method to handle a large influx of data?

- Is it OK to have a primary table like this in which records are added and deleted continually? Does it fragment in the SQL server too heavily?

Thank you
Posted
Comments
Prasad Khandekar 5-Jun-13 14:16pm    
It won't really fragment the database. I will definitely suggest to use a queuing software like MQ to handle this situation. Another approach is to use Oracle Database as it comes with it's own queue implementation called AQ.
RedDk 5-Jun-13 14:46pm    
This might sound funny but what you call a "queue" is really just an exposed interface. TSQL provides a good means to address a time continuum as such with it's indexing capacity and the use of TOP. About that "interface". Think of it as a model on rna/protein/transcription , or google THAT; you've got a determinate function in the codon and a discriminate mechanism in whatever a milieu of substrate is capable of providing for the assembly of a specific longchain item ... say an enzyme, etc ...

1 solution

One solution I came up with was to fire this statement at an interval:

Delete tblUnsubscribeLogQueue
OUTPUT deleted.* INTO tblUnsubscribeLog

I read by using the OUTPUT clause I could be assured that deadlocks would not occur because this was all one operation and I will only have one processes that is deleting records.

Any comments?

Any other thoughts on if this will cause fragmentation?

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900