title: SQLite data types
body: <p>I am using <a href="http://www.sqlite.org/" rel="noreferrer">SQLite</a> in a Java application through <a href="http://www.zentus.com/sqlitejdbc" rel="noreferrer">Zentus</a>. In this context I need to save and query Java <code>long</code> values in my database. Coming from other RDBMS I created the table as following to store long values:</p>
  
  <pre><code>CREATE TABLE myTable (id INTEGER PRIMARY_KEY, longValue LONG)
  </code></pre>
  
  <p>This solution produces the excepted behavior but after reading the <a href="http://www.sqlite.org/datatype3.html" rel="noreferrer">SQLite documentation on data types</a> I understood that my <code>LONG</code> type has the same effect than using <code>TEXT</code> => <code>longValue</code> is stored as text.</p>
  
  <p>I then decided to change this to <code>INTEGER</code> (which length is variable and can store up to 64 bit integers which is the length of Java long) in order to have cleaner code and may be to save some disk space and to increase performances because my longValues are inserted and queried as <code>long</code>.</p>
  
  <p>After comparing the performances and the size of the created databases I am not able to see any difference between:</p>
  
  <pre><code>CREATE TABLE myTable (id INTEGER PRIMARY_KEY, longValue LONG)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>CREATE TABLE myTable (id INTEGER PRIMARY_KEY, longValue INTEGER)
  </code></pre>
  
  <p>Any comments, experiences or feelings on the subject?</p>