title: Deleting data from large database
body: <p>Deleting from a large DB might be a common question although what I want to ask is not how to do this. </p>
  
  <ol>
  <li><p>From what I've read online, the best/efficient way to delete from a large DB is to delete small amounts of data at intervals. In my case, I can't do a <code>TRUNCATE</code>, since data are written in the DB constantly and I might end up losing some while I perform the <code>TRUNCATE</code>, right? </p></li>
  <li><p>When deleting data from the DB, in small or large amounts, it creates an overhead which can degrade performance. I can handle this by optimizing the table after the deletes. What I don't know is would optimizing cause any problems on the data been read or written to the DB at the moment? </p></li>
  </ol>
  
  <p>Maybe I am wrong on my approach on deleting data. If you have any recommendations that would be of great help. </p>