title: Slow query in postgreSQL osm data
body: <p>HI i have a query in PostgreSql and  speed of a query is very slow. How can I speed up query </p>
  
  <p>I select a latitude and longtitude from table nodes , an use functions ST_X and ST_Y , in table nodes is 14 000 000 rows , in table way_tags 5 000 000 an in way_nodes 18 000 000 rows </p>
  
  <p>How can I speed up this query or a database. I have indexes but still is it slow.</p>
  
  <pre><code>SELECT ST_X(geom), ST_Y(geom), wt.way_id
  FROM way_tags wt join way_nodes wn on (wn.way_id=wt.way_id) join nodes n on (wn.node_id=n.id)
  WHERE wt.k='highway' AND wt.v='tertiary'
  ORDER BY wt.way_id ASC, wn.sequence_id ASC
  </code></pre>