title: SQLite optimization -- two databases vs. one
body: <p>I'm developing an iPhone app with two SQLite databases.  I'm wondering if I should be using only one.</p>
  
  <p>The first database has a dozen small tables (each having four or five INTEGER or TEXT columns).  Most of the tables have only a few dozen rows, but one table will have several thousand rows of "Items."  The tables are all related so they have many joins between them.</p>
  
  <p>The second database contains only one table.  It has a BLOB column with one row related to some of the "Items" from the first database (photos of the items).  These BLOBs are only used in a small part of the program, so they are rarely attached or joined with the first database (rows can be fetched easily without joins).</p>
  
  <p>The first database file size will be about a megabyte; the db with the BLOBs will be much larger -- about 50 megabytes.  I separated the BLOBs because I wanted to be able to backup the smaller database without having to carry the BLOBs, too.  I also thought separating the BLOBs might improve performance for the smaller tables, but I'm not sure.</p>
  
  <p>What are the pros and cons of having two databases (SQLIte databases in particular ) to separate the BLOBs, vs. having just one database with a table full of very narrow tables mixed in with the table of BLOBs?</p>