title: Postgres GIST vs Btree index
body: <p>Following on from my previous question on this topic, <a href="https://stackoverflow.com/questions/12701193/postgres-combining-multiple-indexes">Postgres combining multiple Indexes</a>:</p>
  
  <p>I have the following table on Postgres 9.2 (with postgis):</p>
  
  <pre><code>CREATE TABLE updates (
      update_id character varying(50) NOT NULL,
      coords geography(Point,4326) NOT NULL,
      user_id character varying(50) NOT NULL,
      created_at timestamp without time zone NOT NULL
  );
  </code></pre>
  
  <p>And I am running following query on the table:</p>
  
  <pre><code>select * 
  from updates 
  where ST_DWithin(coords, ST_MakePoint(-126.4, 45.32)::geography, 30000) 
  and user_id='3212312' 
  order by created_at desc
  limit 60
  </code></pre>
  
  <p>So given that, what Index should I use for (coords + user_id), GIST or BTree?</p>
  
  <pre><code>CREATE INDEX ix_coords_user_id ON updates USING GIST (coords, user_id);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>CREATE INDEX ix_coords_user_id ON updates (coords, user_id);
  </code></pre>
  
  <p>I was reading that BTree performs better than GIST, but am I forced to use GIST since I am using postgis geography field??</p>