# Slow Geo Queries

**URL:** <https://discuss.elastic.co/t/slow-geo-queries/12077>\
**Category:** Elasticsearch\
**Created:** [May 22, 2013, 3:25pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077 "2013-05-22T15:25:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian\_3](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@christian\_3](https://discuss.elastic.co/u/christian_3)\
**Post date:** [May 22, 2013, 3:25pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/1 "2013-05-22T15:25:32Z")

</div>

Hello,

we are evaluating Elastic Search and have a data set of about 250k  
documents, that contain a geo\_shape property (mostly polygons). When using  
a geo\_shape filter my queries become really slow (multiple seconds). I  
couldn't really find a way to really change this. I tried quadtrees,  
smaller and bigger polygons in queries, etc. No effect. Also I reduced my  
query to a match\_all query with said filter to be sure nothing interferes.  
I was expecting this to go way faster, like other queries, taking a few  
milliseconds.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [May 22, 2013, 7:38pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/2 "2013-05-22T19:38:08Z")

</div>

can you elaborate on the shapes a bit. Are you executing any "Star" shaped  
poligons on a dense area by any chance?

simon

On Wednesday, May 22, 2013 5:25:32 PM UTC+2, [chri...@zoomsquare.com](mailto:chri...@zoomsquare.com) wrote:

> Hello,
> 
> we are evaluating Elastic Search and have a data set of about 250k  
> documents, that contain a geo\_shape property (mostly polygons). When using  
> a geo\_shape filter my queries become really slow (multiple seconds). I  
> couldn't really find a way to really change this. I tried quadtrees,  
> smaller and bigger polygons in queries, etc. No effect. Also I reduced my  
> query to a match\_all query with said filter to be sure nothing interferes.  
> I was expecting this to go way faster, like other queries, taking a few  
> milliseconds.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![christian\_3](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@christian\_3](https://discuss.elastic.co/u/christian_3)\
**Post date:** [May 28, 2013, 12:33pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/3 "2013-05-28T12:33:47Z")

</div>

Both the polygons used for querying and in the documents are streets (with  
buffers around them), street crossings and districts and other parts of  
them. We do a lot intersections using data extracted from place  
descriptions in regarding real estates before the result of these  
intersections goes into ES. The query then is some district or street for  
example, maybe even a whole city.

Am Mittwoch, 22. Mai 2013 21:38:08 UTC+2 schrieb simonw:

> can you elaborate on the shapes a bit. Are you executing any "Star" shaped  
> poligons on a dense area by any chance?
> 
> simon
> 
> On Wednesday, May 22, 2013 5:25:32 PM UTC+2, [chri...@zoomsquare.com](mailto:chri...@zoomsquare.com) wrote:
> 
> > Hello,
> > 
> > we are evaluating Elastic Search and have a data set of about 250k  
> > documents, that contain a geo\_shape property (mostly polygons). When using  
> > a geo\_shape filter my queries become really slow (multiple seconds). I  
> > couldn't really find a way to really change this. I tried quadtrees,  
> > smaller and bigger polygons in queries, etc. No effect. Also I reduced my  
> > query to a match\_all query with said filter to be sure nothing interferes.  
> > I was expecting this to go way faster, like other queries, taking a few  
> > milliseconds.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [May 28, 2013, 12:59pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/4 "2013-05-28T12:59:53Z")

</div>

I wonder if interpolating the streets and reducing the num of polygon  
points make a difference here? How many points do you have?

simon

On Tuesday, May 28, 2013 2:33:47 PM UTC+2, [chri...@zoomsquare.com](mailto:chri...@zoomsquare.com) wrote:

> Both the polygons used for querying and in the documents are streets (with  
> buffers around them), street crossings and districts and other parts of  
> them. We do a lot intersections using data extracted from place  
> descriptions in regarding real estates before the result of these  
> intersections goes into ES. The query then is some district or street for  
> example, maybe even a whole city.
> 
> Am Mittwoch, 22. Mai 2013 21:38:08 UTC+2 schrieb simonw:
> 
> > can you elaborate on the shapes a bit. Are you executing any "Star"  
> > shaped poligons on a dense area by any chance?
> > 
> > simon
> > 
> > On Wednesday, May 22, 2013 5:25:32 PM UTC+2, chri...@zoomsquare.comwrote:
> > 
> > > Hello,
> > > 
> > > we are evaluating Elastic Search and have a data set of about 250k  
> > > documents, that contain a geo\_shape property (mostly polygons). When using  
> > > a geo\_shape filter my queries become really slow (multiple seconds). I  
> > > couldn't really find a way to really change this. I tried quadtrees,  
> > > smaller and bigger polygons in queries, etc. No effect. Also I reduced my  
> > > query to a match\_all query with said filter to be sure nothing interferes.  
> > > I was expecting this to go way faster, like other queries, taking a few  
> > > milliseconds.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![christian\_3](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@christian\_3](https://discuss.elastic.co/u/christian_3)\
**Post date:** [May 28, 2013, 2:12pm UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/5 "2013-05-28T14:12:15Z")

</div>

No, I tried this at least with the polygons for queries and it didn't  
really make a difference how big that polygon was. I am not sure, but  
since ES uses geohashes, wouldn't it mean that this doesn't really make a  
difference?

Changing the precision has a slight effect though, even though it was s  
really small one.

Am Dienstag, 28. Mai 2013 14:59:53 UTC+2 schrieb simonw:

> I wonder if interpolating the streets and reducing the num of polygon  
> points make a difference here? How many points do you have?
> 
> simon
> 
> On Tuesday, May 28, 2013 2:33:47 PM UTC+2, [chri...@zoomsquare.com](mailto:chri...@zoomsquare.com) wrote:
> 
> > Both the polygons used for querying and in the documents are streets  
> > (with buffers around them), street crossings and districts and other parts  
> > of them. We do a lot intersections using data extracted from place  
> > descriptions in regarding real estates before the result of these  
> > intersections goes into ES. The query then is some district or street for  
> > example, maybe even a whole city.
> > 
> > Am Mittwoch, 22. Mai 2013 21:38:08 UTC+2 schrieb simonw:
> > 
> > > can you elaborate on the shapes a bit. Are you executing any "Star"  
> > > shaped poligons on a dense area by any chance?
> > > 
> > > simon
> > > 
> > > On Wednesday, May 22, 2013 5:25:32 PM UTC+2, chri...@zoomsquare.comwrote:
> > > 
> > > > Hello,
> > > > 
> > > > we are evaluating Elastic Search and have a data set of about 250k  
> > > > documents, that contain a geo\_shape property (mostly polygons). When using  
> > > > a geo\_shape filter my queries become really slow (multiple seconds). I  
> > > > couldn't really find a way to really change this. I tried quadtrees,  
> > > > smaller and bigger polygons in queries, etc. No effect. Also I reduced my  
> > > > query to a match\_all query with said filter to be sure nothing interferes.  
> > > > I was expecting this to go way faster, like other queries, taking a few  
> > > > milliseconds.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:34am UTC](https://discuss.elastic.co/t/slow-geo-queries/12077/6 "2017-07-06T02:34:22Z")

</div>


