Skip to content

ESQL: Short circuit loading empty doc values#102434

Merged
nik9000 merged 2 commits into
elastic:mainfrom
nik9000:esql_fully_skip_nulls
Nov 22, 2023
Merged

ESQL: Short circuit loading empty doc values#102434
nik9000 merged 2 commits into
elastic:mainfrom
nik9000:esql_fully_skip_nulls

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Nov 21, 2023

This optimizes loading from empty doc values by returning a builder that always returns a ConstantNullBlock without without needing to perform and per-tuple work. This really improves workloads where most fields are missing:

|                Min Throughput |   3.6941  |  6.49017 |   2.79608 |  ops/s | +75.69% |
|               Mean Throughput |   3.99176 |  7.26555 |   3.27379 |  ops/s | +82.01% |
|             Median Throughput |   4.02304 |  7.34932 |   3.32628 |  ops/s | +82.68% |
|                Max Throughput |   4.16047 |  7.71378 |   3.55331 |  ops/s | +85.41% |
|       50th percentile latency | 153.725   | 69.5784  | -84.1469  |     ms | -54.74% |
|       90th percentile latency | 163.613   | 74.8399  | -88.7731  |     ms | -54.26% |
|       99th percentile latency | 172.899   | 86.3224  | -86.5764  |     ms | -50.07% |
|      100th percentile latency | 184.158   | 88.4151  | -95.7431  |     ms | -51.99% |
|  50th percentile service time | 153.725   | 69.5784  | -84.1469  |     ms | -54.74% |
|  90th percentile service time | 163.613   | 74.8399  | -88.7731  |     ms | -54.26% |
|  99th percentile service time | 172.899   | 86.3224  | -86.5764  |     ms | -50.07% |
| 100th percentile service time | 184.158   | 88.4151  | -95.7431  |     ms | -51.99% |

That example above has about 90% of fields declared but missing.

This optimizes loading from empty doc values by returning a builder that
always returns a `ConstantNullBlock` without without needing to perform
and per-tuple work. This *really* improves workloads where most fields
are missing:
```
|                Min Throughput |   3.6941  |  6.49017 |   2.79608 |  ops/s | +75.69% |
|               Mean Throughput |   3.99176 |  7.26555 |   3.27379 |  ops/s | +82.01% |
|             Median Throughput |   4.02304 |  7.34932 |   3.32628 |  ops/s | +82.68% |
|                Max Throughput |   4.16047 |  7.71378 |   3.55331 |  ops/s | +85.41% |
|       50th percentile latency | 153.725   | 69.5784  | -84.1469  |     ms | -54.74% |
|       90th percentile latency | 163.613   | 74.8399  | -88.7731  |     ms | -54.26% |
|       99th percentile latency | 172.899   | 86.3224  | -86.5764  |     ms | -50.07% |
|      100th percentile latency | 184.158   | 88.4151  | -95.7431  |     ms | -51.99% |
|  50th percentile service time | 153.725   | 69.5784  | -84.1469  |     ms | -54.74% |
|  90th percentile service time | 163.613   | 74.8399  | -88.7731  |     ms | -54.26% |
|  99th percentile service time | 172.899   | 86.3224  | -86.5764  |     ms | -50.07% |
| 100th percentile service time | 184.158   | 88.4151  | -95.7431  |     ms | -51.99% |
```

That example above has about 90% of fields declared but missing.
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @nik9000, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

Copy link
Copy Markdown
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, Nik.

@nik9000 nik9000 merged commit 5f408c6 into elastic:main Nov 22, 2023
@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Nov 22, 2023

Thanks @dnhatn !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement Team:QL (Deprecated) Meta label for query languages team v8.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants