Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

  • Dbal KeySet extractor

Fixed

Changed

Removed

Deprecated

Security


Description

KeySet based pagination is much better for larger datasets than a limit/offset one, please find more details in: https://use-the-index-luke.com/sql/partial-results/fetch-next-page

@norberttech norberttech linked an issue Apr 26, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2025

Flow PHP - Benchmarks

Results of the benchmarks from this PR are compared with the results from 1.x branch.

Extractors
+-----------------------+-------------------+------+-----+-----------------+------------------+----------------+
| benchmark             | subject           | revs | its | mem_peak        | mode             | rstdev         |
+-----------------------+-------------------+------+-----+-----------------+------------------+----------------+
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.874mb +0.17%  | 616.066ms -1.13% | ±0.16% -82.71% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 5.368mb +1.87%  | 1.338s -1.27%    | ±1.99% -23.38% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.471mb +0.01% | 910.914ms -1.73% | ±0.48% -25.62% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.598mb +0.18%  | 39.092ms +0.88%  | ±0.23% -70.00% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.573mb +0.18%  | 602.418ms +1.11% | ±0.72% +67.76% |
+-----------------------+-------------------+------+-----+-----------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.396mb +0.01% | 67.347ms -2.94% | ±0.51% -20.13% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev         |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 64.041mb +0.01%  | 102.083ms -2.28% | ±1.22% +7.31%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.073mb +0.01%  | 95.638ms -1.90%  | ±0.33% -53.39% |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 166.555mb +0.01% | 20.604s -0.97%   | ±0.18% -91.22% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 18.131mb +0.05%  | 30.489ms -1.50%  | ±1.63% +12.88% |
+--------------------+----------------+------+-----+------------------+------------------+----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+-------------------------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev                        |
+-------------------+----------------------------+------+-----+------------------+------------------+-------------------------------+
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.058mb +0.01%  | 3.083ms -4.48%   | ±1.65% -13.36%                |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.415mb +0.01% | 181.783ms -1.85% | ±0.80% +55.28%                |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.135mb +0.01%  | 18.302ms -0.19%  | ±1.26% -20.88%                |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.933mb +0.01%  | 1.523ms +2.33%   | ±0.98% -44.22%                |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.933mb +0.01%  | 1.422ms -5.11%   | ±1.94% -9.39%                 |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.094mb +0.01%  | 3.732ms -14.53%  | ±0.75% -42.34%                |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.623mb +0.01%  | 15.975ms -3.41%  | ±1.07% +85.77%                |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.623mb +0.01%  | 15.972ms -2.73%  | ±0.66% -78.66%                |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.314mb +0.01%  | 1.706μs +6.63%   | ±2.72% +19597082069310000.00% |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.314mb +0.01%  | 0.400μs 0.00%    | ±0.00% 0.00%                  |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.532mb +0.01% | 14.852ms +0.00%  | ±0.18% -67.00%                |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.599mb +0.01% | 68.719ms -4.44%  | ±0.89% -2.41%                 |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.142mb +0.01%  | 1.409ms +3.46%   | ±0.19% -95.07%                |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.514mb +0.01% | 60.669ms -3.96%  | ±0.64% +191.49%               |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.195mb +0.01%  | 3.894ms +4.25%   | ±3.19% +540.77%               |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.676mb +0.01%  | 39.325ms -3.21%  | ±1.43% -11.71%                |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.677mb +0.01%  | 40.083ms +0.36%  | ±1.12% +38.76%                |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.676mb +0.01%  | 40.499ms +0.65%  | ±1.73% +54.11%                |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.754mb +0.01%  | 8.275ms +0.52%   | ±0.88% +89.63%                |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.504mb +0.01%  | 29.609ms -1.07%  | ±0.10% -95.87%                |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.314mb +0.01%  | 13.049μs -8.05%  | ±2.84% -11.92%                |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.314mb +0.01%  | 15.416μs -0.33%  | ±3.16% -3.81%                 |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.416mb +0.01% | 181.809ms -2.64% | ±0.79% -23.46%                |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 44.039mb +0.02%  | 460.441ms -0.93% | ±0.62% -66.68%                |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.849mb +0.07%  | 94.006ms -0.01%  | ±0.65% -63.24%                |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.505mb +0.01% | 717.718ms -0.73% | ±1.16% +116.35%               |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.014mb +0.01%  | 364.572ms -0.70% | ±0.90% +56.40%                |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.792mb +0.06%  | 77.989ms -0.09%  | ±0.24% -62.68%                |
+-------------------+----------------------------+------+-----+------------------+------------------+-------------------------------+

@codecov
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 91.35802% with 7 lines in your changes missing coverage. Please review.

Project coverage is 83.19%. Comparing base (65b2c67) to head (56e19d0).
Report is 2 commits behind head on 1.x.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1603      +/-   ##
==========================================
+ Coverage   83.16%   83.19%   +0.02%     
==========================================
  Files         700      703       +3     
  Lines       18956    19037      +81     
==========================================
+ Hits        15765    15838      +73     
- Misses       3191     3199       +8     
Components Coverage Δ
etl 86.25% <ø> (ø)
cli 84.59% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 90.11% <ø> (ø)
lib-filesystem 78.02% <ø> (ø)
lib-parquet 84.36% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-snappy 90.69% <ø> (-0.47%) ⬇️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 74.41% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.57% <ø> (ø)
adapter-doctrine 89.51% <91.35%> (+0.37%) ⬆️
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech norberttech merged commit f3f025a into 1.x Apr 26, 2025
22 checks passed
@norberttech norberttech deleted the 1598-keyset-pagination-for-dbal-extractor branch April 26, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keyset pagination for dbal extractor

2 participants