title: mySQL (and MSSQL), using both indexed and non-indexed columns in where clause
body: <p>The database I use is currently mySQL but maybe later MSSQL.</p>
  
  <p>My questing is about how mySQL and msSQL takes care about indexed and nonindexed columns.</p>
  
  <p>Lets say I have a simple table like this:</p>
  
  <p>*table_ID        -Auto increase. just a ID, <b>indexed</b>.<br>
  *table_user_ID     -every user has a unique ID  <b>indexed</b><br>
  *table_somOtherID     -some data..<br>
  *....<br></p>
  
  <p>Lets say that I have A LOT!! of rows in this table, But the number of rows that every user add to this table is very small (10-100)</p>
  
  <p>And I want to find one o a few specific rows in this table. a row or rows from a specific User(indexed column).</p>
  
  <p>If I use the following WHERE clause:
  ..... WHERE table_user_ID= 'someID' AND table_someOtherID='anotherValue'.</p>
  
  <p>Will the database first search for the indexed columns, and then search for the "anotherValue" inside of those rows, or how does the database handle this?</p>
  
  <p>I guess the database will increase a lot if I have to index every column in all tables.. 
  But what do you think, is it enough to index those columns that will decrease the number of rows to just ten maybe hundred?</p>