title: Retrieve user relation data from massive files, trying cascade delete rules
body: <p>I got millions of user relation data crawling from a social network. Such data stored in the format:</p>
  
  <ol>
  <li>A B</li>
  <li>A C</li>
  <li>A E</li>
  <li>B F</li>
  <li>B A</li>
  <li>B D</li>
  <li>C F</li>
  <li>D O</li>
  <li>D P</li>
  <li>E X</li>
  <li>E M
  ...</li>
  </ol>
  
  <p>However, I do not need all of this data. I only care about some special users (verified users), such as A, B and C.</p>
  
  <p>My question is how can I retrieve users' relation data for verified users only from this massive data. I am writing a program to do so but I find that it takes ages to do it because the size of the data (about 8GB). If I stored such data into a SQL database and use some cascade delete rules, will it be faster? Do you guys have some suggestion? Many thanks.</p>
  
  <p>By the way, the user relation data was stored in 180 text files. Each file containing 1 million relations in the form described above.</p>