For example, I need to get all cities of some country, so I built this query:
[out:json][timeout:180];
area["name:en"="Russia"]["boundary"="administrative"]->.myarea;
node(area.myarea)[place="city"];
out qt;
It executes not so quickly, because, seems, Overpass at first lookup all nodes, matched to myarea
, and after this - filter them via place="city"
, yes?
So if I modify the query to this:
[out:json][timeout:180];
area["name:en"="Russia"]["boundary"="administrative"]->.myarea;
node[place="city"](area.myarea);
out qt;
Overpass will do first filter of nodes via place="city"
, that must execute much quicker because of direct match, than area match query, and in second iteration - filter only little part of nodes by myarea
area.
Is my guess right, or Overpass have some query optimizer, that will do this for all queries?