Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a filter instead of must?

{
"geo_shape": {
"location": {
"shape": { "type": "circle", "radius": "300km", "coordinates": [7, 55] },
"relation": "intersects"
}
}
},
{
"bool": {
"must_not": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a must not, could we use a disjoint spatial relationship?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disjoint version was the original version. This is an alternative query that deliberately does things differently, to see if that makes a difference to the performance. It does not seem to make any difference.

{
"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