Skip to content

Conversation

jordan-powers
Copy link
Contributor

@jordan-powers jordan-powers commented Aug 5, 2025

This PR builds on the work in #132142 to optimize loading values from _ignored_source by stopping the FieldVisitor early, once all required fields have been visited.

Part of this change is to change the signature of BlockLoader#FieldsSpec so that the returned object tracks fields from ignored source separately from fields from other stored fields. This is needed so that the custom field visitor knows which fields to look for.

Relates to #130886.

@jordan-powers jordan-powers added >non-issue Team:StorageEngine :StorageEngine/Mapping The storage related side of mappings v9.1.1 :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL labels Aug 5, 2025
@jordan-powers jordan-powers added the test-full-bwc Trigger full BWC version matrix tests label Aug 5, 2025
@jordan-powers
Copy link
Contributor Author

Here are the results for the insist_🐔 benchmarks run against main:
baseline: 68eff34
contender: 1e3421f

|                                                        Metric |                            Task |         Baseline |        Contender |              Diff |   Unit |   Diff % |
|--------------------------------------------------------------:|--------------------------------:|-----------------:|-----------------:|------------------:|-------:|---------:|
|                    Cumulative indexing time of primary shards |                                 |    721.795       |    717.24        |      -4.55495     |    min |   -0.63% |
|             Min cumulative indexing time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|          Median cumulative indexing time across primary shard |                                 |      7.86623     |      8.33404     |       0.46782     |    min |   +5.95% |
|             Max cumulative indexing time across primary shard |                                 |    156.141       |    145.257       |     -10.8831      |    min |   -6.97% |
|           Cumulative indexing throttle time of primary shards |                                 |      0           |      0           |       0           |    min |    0.00% |
|    Min cumulative indexing throttle time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
| Median cumulative indexing throttle time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|    Max cumulative indexing throttle time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|                       Cumulative merge time of primary shards |                                 |    227.479       |    239.143       |      11.6639      |    min |   +5.13% |
|                      Cumulative merge count of primary shards |                                 |    394           |    549           |     155           |        |  +39.34% |
|                Min cumulative merge time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|             Median cumulative merge time across primary shard |                                 |      1.3245      |      1.50917     |       0.18467     |    min |  +13.94% |
|                Max cumulative merge time across primary shard |                                 |     60.9483      |     59.4936      |      -1.45475     |    min |   -2.39% |
|              Cumulative merge throttle time of primary shards |                                 |     63.2614      |     85.2187      |      21.9573      |    min |  +34.71% |
|       Min cumulative merge throttle time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|    Median cumulative merge throttle time across primary shard |                                 |      0.312058    |      0.582642    |       0.27058     |    min |  +86.71% |
|       Max cumulative merge throttle time across primary shard |                                 |     16.6081      |     21.6645      |       5.05642     |    min |  +30.45% |
|                     Cumulative refresh time of primary shards |                                 |      9.53073     |      6.99613     |      -2.5346      |    min |  -26.59% |
|                    Cumulative refresh count of primary shards |                                 |   5993           |   6272           |     279           |        |   +4.66% |
|              Min cumulative refresh time across primary shard |                                 |      0           |      0           |       0           |    min |    0.00% |
|           Median cumulative refresh time across primary shard |                                 |      0.0446667   |      0.069075    |       0.02441     |    min |  +54.65% |
|              Max cumulative refresh time across primary shard |                                 |      2.7209      |      1.52578     |      -1.19512     |    min |  -43.92% |
|                       Cumulative flush time of primary shards |                                 |    143.493       |    124.21        |     -19.2835      |    min |  -13.44% |
|                      Cumulative flush count of primary shards |                                 |   5562           |   5692           |     130           |        |   +2.34% |
|                Min cumulative flush time across primary shard |                                 |      0.000316667 |      5e-05       |      -0.00027     |    min |  -84.21% |
|             Median cumulative flush time across primary shard |                                 |      1.92777     |      1.78622     |      -0.14155     |    min |   -7.34% |
|                Max cumulative flush time across primary shard |                                 |     26.0975      |     20.6529      |      -5.44462     |    min |  -20.86% |
|                                       Total Young Gen GC time |                                 |    248.342       |    158.111       |     -90.231       |      s |  -36.33% |
|                                      Total Young Gen GC count |                                 |  23930           |  15143           |   -8787           |        |  -36.72% |
|                                         Total Old Gen GC time |                                 |      0           |      0           |       0           |      s |    0.00% |
|                                        Total Old Gen GC count |                                 |      0           |      0           |       0           |        |    0.00% |
|                                                  Dataset size |                                 |     52.1781      |     51.8891      |      -0.28901     |     GB |   -0.55% |
|                                                    Store size |                                 |     52.1781      |     51.8891      |      -0.28901     |     GB |   -0.55% |
|                                                 Translog size |                                 |      4.09782e-06 |      4.09782e-06 |       0           |     GB |    0.00% |
|                                        Heap used for segments |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                      Heap used for doc values |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                           Heap used for terms |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                           Heap used for norms |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                          Heap used for points |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                   Heap used for stored fields |                                 |      0           |      0           |       0           |     MB |    0.00% |
|                                                 Segment count |                                 |   1026           |   1023           |      -3           |        |   -0.29% |
|                                   Total Ingest Pipeline count |                                 |      4.88622e+08 |      4.8861e+08  |  -12000           |        |   -0.00% |
|                                    Total Ingest Pipeline time |                                 |      1.70642e+07 |      1.59295e+07 |      -1.13466e+06 |     ms |   -6.65% |
|                                  Total Ingest Pipeline failed |                                 |      0           |      0           |       0           |        |    0.00% |
|                                                Min Throughput |                insert-pipelines |      7.19027     |      7.48167     |       0.2914      |  ops/s |   +4.05% |
|                                               Mean Throughput |                insert-pipelines |      7.19027     |      7.48167     |       0.2914      |  ops/s |   +4.05% |
|                                             Median Throughput |                insert-pipelines |      7.19027     |      7.48167     |       0.2914      |  ops/s |   +4.05% |
|                                                Max Throughput |                insert-pipelines |      7.19027     |      7.48167     |       0.2914      |  ops/s |   +4.05% |
|                                      100th percentile latency |                insert-pipelines |   2025.98        |   1937.9         |     -88.0809      |     ms |   -4.35% |
|                                 100th percentile service time |                insert-pipelines |   2025.98        |   1937.9         |     -88.0809      |     ms |   -4.35% |
|                                                    error rate |                insert-pipelines |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                      insert-ilm |     21.6649      |     22.34        |       0.67505     |  ops/s |   +3.12% |
|                                               Mean Throughput |                      insert-ilm |     21.6649      |     22.34        |       0.67505     |  ops/s |   +3.12% |
|                                             Median Throughput |                      insert-ilm |     21.6649      |     22.34        |       0.67505     |  ops/s |   +3.12% |
|                                                Max Throughput |                      insert-ilm |     21.6649      |     22.34        |       0.67505     |  ops/s |   +3.12% |
|                                      100th percentile latency |                      insert-ilm |     45.1697      |     43.7527      |      -1.41707     |     ms |   -3.14% |
|                                 100th percentile service time |                      insert-ilm |     45.1697      |     43.7527      |      -1.41707     |     ms |   -3.14% |
|                                                    error rate |                      insert-ilm |      0           |      0           |       0           |      % |    0.00% |
|                                      100th percentile latency | update-custom-package-templates |     20.0145      |     23.0722      |       3.0578      |     ms |  +15.28% |
|                                 100th percentile service time | update-custom-package-templates |     20.0145      |     23.0722      |       3.0578      |     ms |  +15.28% |
|                                                    error rate | update-custom-package-templates |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                      bulk-index |   1206.13        |    692.62        |    -513.507       | docs/s |  -42.57% |
|                                               Mean Throughput |                      bulk-index |  40879.2         |  35360.5         |   -5518.7         | docs/s |  -13.50% |
|                                             Median Throughput |                      bulk-index |  40741.2         |  35422.4         |   -5318.81        | docs/s |  -13.06% |
|                                                Max Throughput |                      bulk-index |  43925.3         |  38541.1         |   -5384.19        | docs/s |  -12.26% |
|                                       50th percentile latency |                      bulk-index |   1231.86        |    240.816       |    -991.047       |     ms |  -80.45% |
|                                       90th percentile latency |                      bulk-index |   2108.71        |    517.382       |   -1591.33        |     ms |  -75.46% |
|                                       99th percentile latency |                      bulk-index |   3300.42        |   1568.76        |   -1731.65        |     ms |  -52.47% |
|                                     99.9th percentile latency |                      bulk-index |   9498.4         |   4538.63        |   -4959.77        |     ms |  -52.22% |
|                                    99.99th percentile latency |                      bulk-index |  14210.2         |   6768.96        |   -7441.2         |     ms |  -52.37% |
|                                      100th percentile latency |                      bulk-index |  24020.8         |  10977.8         |  -13043           |     ms |  -54.30% |
|                                  50th percentile service time |                      bulk-index |   1233.53        |    240.858       |    -992.669       |     ms |  -80.47% |
|                                  90th percentile service time |                      bulk-index |   2102.72        |    524.068       |   -1578.66        |     ms |  -75.08% |
|                                  99th percentile service time |                      bulk-index |   3342.63        |   1567.37        |   -1775.27        |     ms |  -53.11% |
|                                99.9th percentile service time |                      bulk-index |   9507.86        |   4507.38        |   -5000.47        |     ms |  -52.59% |
|                               99.99th percentile service time |                      bulk-index |  14222.6         |   6751.11        |   -7471.44        |     ms |  -52.53% |
|                                 100th percentile service time |                      bulk-index |  24020.8         |  10977.8         |  -13043           |     ms |  -54.30% |
|                                                    error rate |                      bulk-index |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                       limit_500 |      7.97479     |     20.2434      |      12.2686      |  ops/s | +153.84% |
|                                               Mean Throughput |                       limit_500 |     14.8373      |     20.2434      |       5.40612     |  ops/s |  +36.44% |
|                                             Median Throughput |                       limit_500 |     14.8373      |     20.2434      |       5.40612     |  ops/s |  +36.44% |
|                                                Max Throughput |                       limit_500 |     21.6998      |     20.2434      |      -1.45639     |  ops/s |   -6.71% |
|                                       50th percentile latency |                       limit_500 |     14.3799      |     13.6506      |      -0.72931     |     ms |   -5.07% |
|                                       90th percentile latency |                       limit_500 |     18.2078      |     18.1996      |      -0.00814     |     ms |   -0.04% |
|                                       99th percentile latency |                       limit_500 |     35.7273      |     22.2462      |     -13.4811      |     ms |  -37.73% |
|                                      100th percentile latency |                       limit_500 |     35.7575      |     25.3595      |     -10.3981      |     ms |  -29.08% |
|                                  50th percentile service time |                       limit_500 |     14.3799      |     13.6506      |      -0.72931     |     ms |   -5.07% |
|                                  90th percentile service time |                       limit_500 |     18.2078      |     18.1996      |      -0.00814     |     ms |   -0.04% |
|                                  99th percentile service time |                       limit_500 |     35.7273      |     22.2462      |     -13.4811      |     ms |  -37.73% |
|                                 100th percentile service time |                       limit_500 |     35.7575      |     25.3595      |     -10.3981      |     ms |  -29.08% |
|                                                    error rate |                       limit_500 |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                       chicken_1 |      7.77357     |      5.77578     |      -1.99778     |  ops/s |  -25.70% |
|                                               Mean Throughput |                       chicken_1 |      7.77357     |      5.77578     |      -1.99778     |  ops/s |  -25.70% |
|                                             Median Throughput |                       chicken_1 |      7.77357     |      5.77578     |      -1.99778     |  ops/s |  -25.70% |
|                                                Max Throughput |                       chicken_1 |      7.77357     |      5.77578     |      -1.99778     |  ops/s |  -25.70% |
|                                       50th percentile latency |                       chicken_1 |     42.0316      |     39.6982      |      -2.33337     |     ms |   -5.55% |
|                                      100th percentile latency |                       chicken_1 |     50.2238      |     41.2344      |      -8.98938     |     ms |  -17.90% |
|                                  50th percentile service time |                       chicken_1 |     42.0316      |     39.6982      |      -2.33337     |     ms |   -5.55% |
|                                 100th percentile service time |                       chicken_1 |     50.2238      |     41.2344      |      -8.98938     |     ms |  -17.90% |
|                                                    error rate |                       chicken_1 |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                       chicken_2 |      0.00154722  |      0.00370847  |       0.00216     |  ops/s | +139.69% |
|                                               Mean Throughput |                       chicken_2 |      0.00155002  |      0.00372183  |       0.00217     |  ops/s | +140.11% |
|                                             Median Throughput |                       chicken_2 |      0.00155016  |      0.0037236   |       0.00217     |  ops/s | +140.21% |
|                                                Max Throughput |                       chicken_2 |      0.00155384  |      0.00373175  |       0.00218     |  ops/s | +140.16% |
|                                       50th percentile latency |                       chicken_2 | 645279           | 266362           | -378916           |     ms |  -58.72% |
|                                      100th percentile latency |                       chicken_2 | 651321           | 266450           | -384871           |     ms |  -59.09% |
|                                  50th percentile service time |                       chicken_2 | 645279           | 266362           | -378916           |     ms |  -58.72% |
|                                 100th percentile service time |                       chicken_2 | 651321           | 266450           | -384871           |     ms |  -59.09% |
|                                                    error rate |                       chicken_2 |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                       chicken_3 |      0.00107037  |      0.001852    |       0.00078     |  ops/s |  +73.02% |
|                                               Mean Throughput |                       chicken_3 |      0.00107335  |      0.00185277  |       0.00078     |  ops/s |  +72.62% |
|                                             Median Throughput |                       chicken_3 |      0.00107395  |      0.00185266  |       0.00078     |  ops/s |  +72.51% |
|                                                Max Throughput |                       chicken_3 |      0.00107629  |      0.00185373  |       0.00078     |  ops/s |  +72.23% |
|                                       50th percentile latency |                       chicken_3 | 940807           | 540506           | -400302           |     ms |  -42.55% |
|                                      100th percentile latency |                       chicken_3 | 946406           | 540628           | -405778           |     ms |  -42.88% |
|                                  50th percentile service time |                       chicken_3 | 940807           | 540506           | -400302           |     ms |  -42.55% |
|                                 100th percentile service time |                       chicken_3 | 946406           | 540628           | -405778           |     ms |  -42.88% |
|                                                    error rate |                       chicken_3 |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |            chicken_3_with_where |     23.8234      |     33.345       |       9.52157     |  ops/s |  +39.97% |
|                                               Mean Throughput |            chicken_3_with_where |     23.8234      |     33.345       |       9.52157     |  ops/s |  +39.97% |
|                                             Median Throughput |            chicken_3_with_where |     23.8234      |     33.345       |       9.52157     |  ops/s |  +39.97% |
|                                                Max Throughput |            chicken_3_with_where |     23.8234      |     33.345       |       9.52157     |  ops/s |  +39.97% |
|                                       50th percentile latency |            chicken_3_with_where |      8.46259     |      7.16501     |      -1.29758     |     ms |  -15.33% |
|                                      100th percentile latency |            chicken_3_with_where |      9.69063     |      7.39183     |      -2.29881     |     ms |  -23.72% |
|                                  50th percentile service time |            chicken_3_with_where |      8.46259     |      7.16501     |      -1.29758     |     ms |  -15.33% |
|                                 100th percentile service time |            chicken_3_with_where |      9.69063     |      7.39183     |      -2.29881     |     ms |  -23.72% |
|                                                    error rate |            chicken_3_with_where |      0           |      0           |       0           |      % |    0.00% |
|                                                Min Throughput |                       chicken_4 |      0.00555192  |      0.00978074  |       0.00423     |  ops/s |  +76.17% |
|                                               Mean Throughput |                       chicken_4 |      0.00562589  |      0.0104291   |       0.0048      |  ops/s |  +85.38% |
|                                             Median Throughput |                       chicken_4 |      0.00560198  |      0.0103003   |       0.0047      |  ops/s |  +83.87% |
|                                                Max Throughput |                       chicken_4 |      0.00570013  |      0.0115332   |       0.00583     |  ops/s | +102.33% |
|                                       50th percentile latency |                       chicken_4 | 175925           |  84303.1         |  -91621.5         |     ms |  -52.08% |
|                                      100th percentile latency |                       chicken_4 | 203507           | 151506           |  -52000.3         |     ms |  -25.55% |
|                                  50th percentile service time |                       chicken_4 | 175925           |  84303.1         |  -91621.5         |     ms |  -52.08% |
|                                 100th percentile service time |                       chicken_4 | 203507           | 151506           |  -52000.3         |     ms |  -25.55% |
|                                                    error rate |                       chicken_4 |      0           |      0           |       0           |      % |    0.00% |

Seems to be an good improvement across the board, especially with chicken_2 and chicken_3 showing around 50% reduction in latency.

@jordan-powers jordan-powers force-pushed the unmapped-fields-special-field-visitor-2 branch from 96fb75e to 0d59c1d Compare August 14, 2025 19:17
@jordan-powers jordan-powers added the test-release Trigger CI checks against release build label Aug 20, 2025
@jordan-powers jordan-powers marked this pull request as ready for review August 21, 2025 14:52
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

RowStrideReader rowStrideReader(LeafReaderContext context) throws IOException;

StoredFieldsSpec rowStrideStoredFieldSpec();
record FieldsSpec(StoredFieldsSpec storedFieldsSpec, IgnoredFieldsSpec ignoredFieldsSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to extend StoredFieldsSpec to know about ignored fields, instead of having this new abstraction on top? I think that would make a lot of the logic here easier to follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was reluctant to do so because StoredFieldsSpec is used in a few other places, and I only need the IgnoredFieldsSpec in the ESQL blockloader context.

Copy link
Member

@martijnvg martijnvg Aug 27, 2025

Choose a reason for hiding this comment

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

I'm also leaning towards keeping FieldsSpec in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

After taking a second look at this, if we're able to add IgnoredFieldsSpec to StoredFieldsSpec and make it optional then I think it would reduce the size of this PR? By adding a constructor to StoredFieldSpec:

public StoredFieldsSpec(boolean requiresSource, boolean requiresMetadata, Set<String> requiredStoredFields) {
        this(requiresSource, requiresMetadata, requiredStoredFields, IgnoredFieldsSpec.NONE);
    }

(the StoredFieldsSpec#merge(...) method also needs to be updated, but from there we can delegate to IgnoredFieldsSpec)

StoredFieldSpec is used in fetch phase and value fetchers, but I think we don't need to make any changes in these areas of the code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I moved IgnoredFieldsSpec into StoredFieldsSpec in 9fb1125

@jdcryans jdcryans requested a review from martijnvg August 26, 2025 15:39
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

Thanks @jordan-powers, this looks good! I think we should add more unit testing around IgnoredSourceFieldLoader and StoredFieldLoader#fromSpec(...).

Comment on lines +38 to +42
for (String requiredIgnoredField : spec.ignoredFieldsSpec().requiredIgnoredFields()) {
for (String potentialStoredField : spec.ignoredFieldsSpec().format().requiredStoredFields(requiredIgnoredField)) {
potentialFieldsInIgnoreSource.computeIfAbsent(potentialStoredField, k -> new HashSet<>()).add(requiredIgnoredField);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I hoping that we can optimize/simplify in a follow up change. This logic is now required for fields with dots and then we don't know which field part there is actually a stored field for.

Ideally we would know based from the mapping what stored field we need. For example if attributes.host.ip is requested and no attributes field is mapped, then the stored field should be _ignored_source.attributes. If attributes is mapped, but host isn't then the required stored field to load would be _ignored_source.attributes.host.

I also think requiredStoredFields(...) also always include the _doc field (via FallbackSyntheticSourceBlockLoader.splitIntoFieldPaths(...))?

Would be great if we need less maps and no sets in SFV.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, this can probably be optimized by using the mapping to figure out which stored field contains the value instead of just looking at all possible parent stored fields. But let's leave that as a follow-up.

return potentialFieldsInIgnoreSource.keySet().stream().toList();
}

static class SFV extends StoredFieldVisitor {
Copy link
Member

Choose a reason for hiding this comment

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

In the future we can perhaps explore an implementation that is tuned for just fetching one stored field.

/**
* Crates a new StoredFieldLaoader using a BlockLoader.FieldsSpec
*/
public static StoredFieldLoader fromSpec(BlockLoader.FieldsSpec spec, boolean forceSequentialReader) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a unit test that tests whether the ignored source field loader is loaded when expected? Maybe we can add a test to BlockSourceReaderTests and then also test the produced block? I think current tests in BlockSourceReaderTests don't test ignored source?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe adding a test to IgnoredSourceFieldMapperTests? But I don't see any block related tests there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I added StoredFieldLoaderTests and IgnoredFieldLoaderTests

RowStrideReader rowStrideReader(LeafReaderContext context) throws IOException;

StoredFieldsSpec rowStrideStoredFieldSpec();
record FieldsSpec(StoredFieldsSpec storedFieldsSpec, IgnoredFieldsSpec ignoredFieldsSpec) {
Copy link
Member

@martijnvg martijnvg Aug 27, 2025

Choose a reason for hiding this comment

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

I'm also leaning towards keeping FieldsSpec in this PR.

@jordan-powers jordan-powers force-pushed the unmapped-fields-special-field-visitor-2 branch from ddc51a6 to ac52d06 Compare August 27, 2025 21:28
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jordan-powers jordan-powers enabled auto-merge (squash) August 29, 2025 12:45
@jordan-powers jordan-powers merged commit 6ab73a1 into elastic:main Aug 29, 2025
29 checks passed
jordan-powers added a commit that referenced this pull request Sep 5, 2025
In #132142 and #132428 we split up ignored_source entries into distinct
lucene fields, then added an optimized field visitor to speed up
retrieving unmapped values for INSIST_🐔.

However, since this approach creates a unique lucene field for every
ignored_source entry, we can very quickly have a lot of lucene fields
if there are a lot of unique unmapped fields per document. This can
cause significant slowdowns in indexing throughput and merge time.

This PR addresses those limitations by reverting back to keeping all
ignored_source entries under the same lucene field. However, we still
keep some of the speedups from that prior work by continuing to 
coalesce multiple ignored_source entries for the same field into a
single entry, allowing the field visitor to exit early.

Unfortunately, we do lose some time compared to the original
optimizations because now the field visitor cannot look at the
fieldInfo to decide whether or not to visit a field, and it instead
needs to actually visit and materialize each ignored_source entry before
it can decide whether or not to keep it.
@jordan-powers jordan-powers deleted the unmapped-fields-special-field-visitor-2 branch October 1, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine test-full-bwc Trigger full BWC version matrix tests test-release Trigger CI checks against release build v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants