SQL server : XML : Data Base Table Optimization
I have a SQL server DB , which have a Table , which Log every Exceptions with details along with 2 XML's (1 for Requ开发者_Python百科est , 1 for Response).
These 2 XML's are Compressed.
Now as the Data volume is high , I need to clean the Table in every 3-4 month.
What are the Optimization technique , I can use to avoid Data Clean up's.
- Create Indexes on all columns that require searching.
- Run
optimize table tablename
(or similar according to your RDBMS) through cron job every day.
Probably the best thing you can look into is table partitioning, which will allow you to quickly remove data when it needs age out. Also, make sure that you cluster your index on a monotonically increasing value (either a surrogate identity value or a datetime column, like dateofreciept); this will reduce fragmentation on the clustered index.
精彩评论