Skip to content

Commit

Permalink
Refined ESQL benchmarks, fixed NaN and removed segment (#457)
Browse files Browse the repository at this point in the history
* Fixed NaN results in `avg_tip_percent_esql` query
* Removed all `segment` partitioning operations since they were unused
* Added `setup` tags to the re-indexing to allow benchmark-only runs with `--exclude-tasks="tag:setup`
  • Loading branch information
craigtaverner authored Sep 19, 2023
1 parent a40f531 commit cac6c33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 80 deletions.
15 changes: 10 additions & 5 deletions nyc_taxis/challenges/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@
"default": false,
"schedule": [
{
"operation": "delete-index"
"operation": "delete-index",
"tags": ["setup"]
},
{
"operation": {
Expand All @@ -720,7 +721,8 @@
"index.refresh_interval": "30s",
"index.translog.flush_threshold_size": "4g"
}{%- endif %}
}
},
"tags": ["setup"]
},
{
"name": "check-cluster-health",
Expand All @@ -732,17 +734,20 @@
"wait_for_no_relocating_shards": "true"
},
"retry-until-success": true
}
},
"tags": ["setup"]
},
{
"operation": "index",
"warmup-time-period": 240,
"clients": {{bulk_indexing_clients | default(8)}},
"ignore-response-error-level": "{{error_level | default('non-fatal')}}"
"ignore-response-error-level": "{{error_level | default('non-fatal')}}",
"tags": ["setup"]
},
{
"name": "refresh-after-index",
"operation": "refresh"
"operation": "refresh",
"tags": ["setup"]
},
{
"operation": "avg_passenger_count_aggregation",
Expand Down
84 changes: 9 additions & 75 deletions nyc_taxis/operations/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,18 +695,6 @@
}
}
},
{
"name": "avg_passenger_count_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | stats avg(passenger_count)",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "avg_passenger_count_esql_doc_partitioning",
"operation-type": "raw-request",
Expand All @@ -725,6 +713,13 @@
"request-timeout": 120,
"body": {
"size": 0,
"query": {
"range": {
"fare_amount": {
"gt": 0
}
}
},
"runtime_mappings": {
"tip_percent": {
"type": "double",
Expand All @@ -748,31 +743,19 @@
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | eval tip_percent = tip_amount / fare_amount | stats avg(tip_percent)",
"query" : "from nyc_taxis | where fare_amount > 0 | eval tip_percent = tip_amount / fare_amount | stats avg(tip_percent)",
"pragma" : {
"data_partitioning" : "shard"
}
}
},
{
"name": "avg_tip_percent_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | eval tip_percent = tip_amount / fare_amount | stats avg(tip_percent)",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "avg_tip_percent_esql_doc_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | eval tip_percent = tip_amount / fare_amount | stats avg(tip_percent)",
"query" : "from nyc_taxis | where fare_amount > 0 | eval tip_percent = tip_amount / fare_amount | stats avg(tip_percent)",
"pragma" : {
"data_partitioning" : "doc"
}
Expand Down Expand Up @@ -815,18 +798,6 @@
}
}
},
{
"name": "avg_amount_group_by_integer_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | stats avg(total_amount) by passenger_count | sort passenger_count",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "avg_amount_group_by_integer_esql_doc_partitioning",
"operation-type": "raw-request",
Expand Down Expand Up @@ -876,18 +847,6 @@
}
}
},
{
"name": "avg_amount_group_by_keyword_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | stats avg(total_amount) by rate_code_id | sort rate_code_id",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "avg_amount_group_by_keyword_esql_doc_partitioning",
"operation-type": "raw-request",
Expand Down Expand Up @@ -944,18 +903,6 @@
}
}
},
{
"name": "avg_passenger_count_filtered_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"body": {
"query" : "from nyc_taxis | where total_amount > 60 and rate_code_id==\"2\"| stats avg(passenger_count)",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "avg_passenger_count_filtered_esql_doc_partitioning",
"operation-type": "raw-request",
Expand Down Expand Up @@ -993,19 +940,6 @@
}
}
},
{
"name": "sort_by_ts_esql_segment_partitioning",
"operation-type": "raw-request",
"method": "POST",
"path": "/_esql",
"request-timeout": 120,
"body": {
"query" : "from nyc_taxis | sort pickup_datetime desc | project pickup_datetime, dropoff_datetime, trip_distance| limit 1000",
"pragma" : {
"data_partitioning" : "segment"
}
}
},
{
"name": "sort_by_ts_esql_doc_partitioning",
"operation-type": "raw-request",
Expand Down

0 comments on commit cac6c33

Please sign in to comment.