Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CAN I DO COMPUTE STATISTICS WHILE INSERTING INTO A TABLE

Status
Not open for further replies.

Striker99

Programmer
Oct 31, 2001
34
UA
All,

Can i perform compute statistics on a table, while inserting into a table ? Does it have any effect.

Thanks,
striker99
 
Sort of. Computing statistics shouldn't generally be done after any old insert statement. Most likely the number of changes to the table is relatively small, so refreshing the statistics will just confirm that things are about the same.

The right time to do statistics is when inserts, updates, or deletes cause a sizable percentage change in your data. If you go from 100 rows to 10,000 that would certainly qualify as a big change.

Personally I prefer to collect statistics on a regular schedule (weekly, or at least monthly) and supplement the schedule with refreshes after major application changes.
 
Is the question can I do both without deadlocking or blocking the inserts? yes, you can. "compute statistics" is non blocking. The one thing you can't give for your heart's desire is your heart. - Lois McMaster Bujold
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top