title: is there a strategy for creating proper database indexes?
body: <p>Someone asked the question: "<a href="https://stackoverflow.com/questions/857775/int-bigint-or-uuid-guid-in-oracle-db2-derby-and-hsqldb">INT, BIGINT or UUID/GUID in Oracle, DB2, Derby and HSQLDB?</a>" and I started to think about all the database schemas I've designed and the books that I've read and not one reference gave any <em>real</em> <em>clear</em> advice about creating indexes.</p>
  
  <p>For example; if you have a compound index like</p>
  
  <pre><code>date() ++ foo() ++ bar()
  </code></pre>
  
  <p>While this index is nice for searching and sorting date range data (read; read performance)... it is terrible for writes. (inserts always happen to the right side of the balanced tree forcing re-balancing which is an expensive operation)</p>
  
  <p>Obviously... a) know your data. b) know your use-case. c) know your database engine.</p>
  
  <p>But what are the common sense general rules for defining a reasonable schema for high performance databases?</p>