Skip to content

Commit

Permalink
Added two more distancefilter and updated iterations after new optimi…
Browse files Browse the repository at this point in the history
…zations (#693)

The recent optimization of ESQL distance-sort allows us to benchmark that properly. That PR also did a few bug-fixes to distance filtering, so we added an alternative version of the query that is now also optimized.
  • Loading branch information
craigtaverner authored Oct 17, 2024
1 parent c23a1bf commit dc2e963
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 6 deletions.
24 changes: 18 additions & 6 deletions geopoint/challenges/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,24 @@
"iterations": 50,
"tags": ["distance", "esql"]
},
{
"operation": "distanceFilterCount200x300-alt",
"warmup-iterations": 50,
"iterations": 50,
"tags": ["distance", "esql"]
},
{
"operation": "distanceFilterCount200x300-esql",
"warmup-iterations": 50,
"iterations": 50,
"tags": ["distance", "esql"]
},
{
"operation": "distanceFilterCount200x300-esql-evals",
"warmup-iterations": 10,
"iterations": 10,
"tags": ["distance", "esql"]
},
{
"operation": "distanceFilterCount300",
"warmup-iterations": 50,
Expand All @@ -315,14 +327,14 @@
},
{
"operation": "distanceSort",
"warmup-iterations": 200,
"iterations": 100,
"warmup-iterations": 50,
"iterations": 50,
"tags": ["distance", "sort"]
},
{
"operation": "distanceSort-esql",
"warmup-iterations": 1,
"iterations": 1,
"warmup-iterations": 50,
"iterations": 50,
"tags": ["distance", "esql", "sort"]
},
{
Expand All @@ -333,8 +345,8 @@
},
{
"operation": "distanceFilterSort-esql",
"warmup-iterations": 1,
"iterations": 1,
"warmup-iterations": 200,
"iterations": 100,
"tags": ["distance", "esql", "sort"]
},
{
Expand Down
46 changes: 46 additions & 0 deletions geopoint/operations/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,57 @@
}
}
},
{
"name": "distanceFilterCount200x300-alt",
"operation-type": "search",
"body": {
"query": {
"bool": {
"must": [
{
"geo_shape": {
"location": {
"shape": { "type": "circle", "radius": "300km", "coordinates": [7, 55] },
"relation": "intersects"
}
}
},
{
"bool": {
"must_not": [
{
"geo_shape": {
"location": {
"shape": { "type": "circle", "radius": "200km", "coordinates": [7, 55] },
"relation": "intersects"
}
}
}
]
}
}
]
}
},
"aggs": {
"count": {
"value_count": {
"field": "location"
}
}
}
}
},
{
"name": "distanceFilterCount200x300-esql",
"operation-type": "esql",
"query": "FROM osmgeopoints | WHERE ST_Distance(location, TO_GEOPOINT(\"POINT(7.0 55.0)\")) >= 200000 AND ST_Distance(location, TO_GEOPOINT(\"POINT(7.0 55.0)\")) <= 300000 | STATS count=COUNT(*)"
},
{
"name": "distanceFilterCount200x300-esql-evals",
"operation-type": "esql",
"query": "FROM osmgeopoints | EVAL point=TO_GEOPOINT(\"POINT(7.0 55.0)\") | EVAL distance=ST_Distance(location, point) | WHERE distance >= 200000 AND distance <= 300000 | STATS count=COUNT(*)"
},
{
"name": "distanceFilterCount300",
"operation-type": "search",
Expand Down

0 comments on commit dc2e963

Please sign in to comment.