Optimize STREQUENT queries and fix estimated table row counts

 - Use id instead of strings for matching mimetypes
 - Use inner LIMIT of 25 to prevent the extra subquery
   (also fixes correctness)
 - Reorder JOIN for data-usage-stat JOIN contacts
 - Defeat sqlite3's "optimization" attempt by using +0 on fields
   from contacts/data <-- This is huge

Bug:5560534

Change-Id: I412d359afe07f32643cc2faef8735b719686741f
2 files changed