These are the sorts of queries that jxapi does all the time.<div><br></div><div>hstore's @> and ? operators use index, others don't.</div><div><br></div><div>As far as metrics... an xapi query like [highway=*][ref|name=*][bbox=a,b,c,d] on jxapi was taking ~5-10 hours when it was using "exists(tags, 'highway')" (which doesn't use the index on hstore) while the exact same xapi query using the "tags ? 'highway'" takes about 20 minutes.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 12:23 PM, Martijn van Exel <span dir="ltr"><<a href="mailto:m@rtijn.org" target="_blank">m@rtijn.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Interesting, I have been looking for a way to speed up those types of queries for a while, thanks!<div><br></div><div>Do you have metrics on this?<div class="im"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 10:53 AM, Paul Norman <span dir="ltr"><<a href="mailto:penorman@mac.com" target="_blank">penorman@mac.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Something else is that tags->'highway' in ( 'motorway', 'primary', 'secondary' ) will NOT use indexes on tags.<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">tags @> hstore('highway', 'motorway') OR tags @> hstore('highway', 'primary') OR tags @> hstore('highway', 'secondary') should be significantly faster with proper indexes.<u></u><u></u></span></p>


<p class="MsoNormal"></p></blockquote></div><br><br clear="all"><div><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Martijn van Exel<br><a href="http://oegeo.wordpress.com/" target="_blank">http://oegeo.wordpress.com/</a><br>
<a href="http://openstreetmap.us/" target="_blank">http://openstreetmap.us/</a><br>


</font></span></div>
<br>_______________________________________________<br>
Talk-us mailing list<br>
<a href="mailto:Talk-us@openstreetmap.org">Talk-us@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/talk-us" target="_blank">http://lists.openstreetmap.org/listinfo/talk-us</a><br>
<br></blockquote></div><br></div>