c# - What do you do with your old records? -


many applications accumulate binary dust -- records accumulated on time , never see light of day. our application keeps chat history, , displays last 5 days worth of such records. idea run cleanup operation after while moves old records 'history' table. history table never used, allows run internal statistics, whilst (i assume) enabling better performance on records remaining in main table.

also, if build history table need replicate our tables, or there hidden ms sql function create "shadow tables" automatically.

there no ms sql function create such shadow tables automagically. comes close partitioning, splits storage (fast/slow) while still keeping data in 1 table.

what looking straight archive , purge. simple strategy nightly task to

  1. update static lookup tables (that primary table references)
  2. move records date < getdate()-6 history table
  3. delete records moved

if table has foreign key links to other tables, find unlikely tables need purged unless grow (rare). if other tables have fks primary on other hand, different matter. in case, have move dependent children, primary, delete in reverse order.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -