-
-
Notifications
You must be signed in to change notification settings - Fork 48
refactor: postgresql explain config #2134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- added: InvalidExplainConfigException - exception for invalid EXPLAIN config flag combinations - added: ExplainConfig fluent builder methods: withAnalyze(), withoutAnalyze(), withBuffers(), withoutBuffers(), withTiming(), withoutTiming(), withVerbose(), withoutVerbose(), withCosts(), withoutCosts(), withMemory(), withoutMemory(), withSettings(), withoutSettings(), withSummary(), withoutSummary(), withWal(), withoutWal(), withFormat() - added: ExplainConfig validation - throws InvalidExplainConfigException when BUFFERS, TIMING, or WAL are enabled without ANALYZE - added: PlanSummary::fromArray() static factory method - creates instance from normalized array (inverse of normalize) - added: ExplainConfigTest - unit tests for validation and fluent builder methods - added: PgSqlExplainTest - integration tests with data providers for ExplainConfig combinations - changed: ExplainConfig::withoutAnalyze() auto-disables buffers, timing, and wal options - fixed: ExplainModifier now explicitly sets BUFFERS, TIMING, SUMMARY to OFF when disabled (PostgreSQL defaults could override user config) - fixed: ExplainParser::parseBuffers() now detects Local Hit/Read Blocks for temporary tables
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 1.x #2134 +/- ##
==========================================
+ Coverage 82.88% 83.24% +0.35%
==========================================
Files 1177 1178 +1
Lines 41743 42007 +264
==========================================
+ Hits 34600 34967 +367
+ Misses 7143 7040 -103
🚀 New features to boost your workflow:
|
Contributor
Flow PHP - BenchmarksResults 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 | 2 | 6.011mb -0.00% | 349.190ms +5.52% | ±5.46% +179.20% |
| DbalExtractorBench | bench_extract_10k_keyset | 1 | 2 | 41.613mb +0.00% | 256.303ms +1.42% | ±0.28% -92.12% |
| DbalExtractorBench | bench_extract_10k_limit_offset | 1 | 2 | 41.607mb -0.00% | 232.145ms +10.40% | ±1.63% +139.85% |
| ExcelExtractorBench | bench_extract_10k_ods | 1 | 2 | 67.141mb -0.00% | 989.807ms -0.53% | ±0.17% -44.25% |
| ExcelExtractorBench | bench_extract_10k_xlsx | 1 | 2 | 67.939mb -0.00% | 1.638s +0.75% | ±0.74% +106.13% |
| JsonExtractorBench | bench_extract_10k | 1 | 2 | 6.670mb -0.00% | 1.170s +0.89% | ±0.25% -25.70% |
| ParquetExtractorBench | bench_extract_10k | 1 | 2 | 11.856mb -0.71% | 10.268s -17.27% | ±0.74% -4.65% |
| PostgreSqlExtractorBench | bench_extract_10k_cursor | 1 | 2 | 43.288mb +0.03% | 265.219ms +1.54% | ±0.30% -68.66% |
| PostgreSqlExtractorBench | bench_extract_10k_keyset | 1 | 2 | 43.298mb -0.01% | 447.295ms +2.50% | ±0.80% +483.61% |
| PostgreSqlExtractorBench | bench_extract_10k_limit_offset | 1 | 2 | 43.283mb +0.01% | 410.086ms +2.79% | ±0.28% -72.38% |
| TextExtractorBench | bench_extract_10k | 1 | 2 | 6.001mb -0.00% | 59.294ms +2.31% | ±0.82% +3550.12% |
| XmlExtractorBench | bench_extract_10k | 1 | 2 | 6.021mb -0.00% | 673.205ms +2.76% | ±1.11% +13008.44% |
+--------------------------+--------------------------------+------+-----+-----------------+-------------------+-------------------+
Transformers+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1 | 2 | 182.065mb -0.00% | 94.891ms +1.12% | ±1.11% +194.73% |
| RenameEachEntryTransformerBench | bench_transform_10k_rows | 1 | 2 | 26.800mb -0.00% | 79.720ms +1.60% | ±0.08% -75.12% |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+-----------------+
Loaders+-----------------------+---------------------+------+-----+------------------+------------------+----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-----------------------+---------------------+------+-----+------------------+------------------+----------------+
| CSVLoaderBench | bench_load_10k | 1 | 2 | 102.098mb -0.01% | 115.337ms +4.40% | ±0.03% -74.15% |
| DbalLoaderBench | bench_load_10k | 1 | 2 | 108.523mb -0.06% | 460.450ms +7.89% | ±2.53% +3.63% |
| ExcelLoaderBench | bench_load_10k_ods | 1 | 2 | 102.557mb -0.01% | 268.530ms +0.46% | ±0.54% +80.73% |
| ExcelLoaderBench | bench_load_10k_xlsx | 1 | 2 | 102.739mb -0.00% | 276.398ms -0.35% | ±0.07% -85.35% |
| JsonLoaderBench | bench_load_10k | 1 | 2 | 102.134mb -0.04% | 103.517ms +3.39% | ±3.44% +12.28% |
| ParquetLoaderBench | bench_load_10k | 1 | 2 | 137.535mb -5.41% | 2.174s -11.50% | ±0.12% -63.89% |
| PostgreSqlLoaderBench | bench_load_10k | 1 | 2 | 110.178mb +0.01% | 416.589ms +8.48% | ±0.62% -36.98% |
| TextLoaderBench | bench_load_10k | 1 | 2 | 107.253mb +0.01% | 34.181ms +3.54% | ±0.08% -94.05% |
+-----------------------+---------------------+------+-----+------------------+------------------+----------------+
Building Blocks+-------------------+-----------------------------------+------+-----+------------------+-------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-------------------+-----------------------------------+------+-----+------------------+-------------------+-----------------+
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 127.836mb -0.00% | 580.133ms -0.21% | ±1.17% +549.25% |
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 67.017mb -0.00% | 291.385ms -1.28% | ±1.14% +146.88% |
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 18.105mb -0.00% | 66.972ms +3.31% | ±1.04% +59.01% |
| RowsBench | bench_chunk_1_000_on_10k | 1 | 2 | 110.999mb -0.00% | 322.000μs +30.36% | ±4.35% +436.96% |
| RowsBench | bench_diff_left_100_on_1k | 1 | 2 | 110.978mb +0.00% | 82.637ms -0.71% | ±0.13% -58.97% |
| RowsBench | bench_diff_right_100_on_1k | 1 | 2 | 110.853mb -0.00% | 77.475ms -2.75% | ±0.93% -50.61% |
| RowsBench | bench_drop_100_on_1k | 1 | 2 | 110.811mb -0.02% | 20.000μs +29.03% | ±0.00% -100.00% |
| RowsBench | bench_drop_right_10_on_1k | 1 | 2 | 110.836mb -0.05% | 17.000μs +6.25% | ±5.88% -5.88% |
| RowsBench | bench_entries_on_1k | 1 | 2 | 110.791mb +0.04% | 138.500μs +95.04% | ±3.97% -43.61% |
| RowsBench | bench_filter_on_1k | 1 | 2 | 110.780mb +0.01% | 521.955μs +39.01% | ±4.41% +6.74% |
| RowsBench | bench_find_on_1k | 1 | 2 | 110.766mb +0.00% | 546.493μs +29.96% | ±0.64% -90.21% |
| RowsBench | bench_find_one_on_1k | 1 | 2 | 110.766mb -0.00% | 530.020μs +24.87% | ±1.89% -44.76% |
| RowsBench | bench_first_on_1k | 1 | 2 | 110.799mb -0.00% | 3.000μs +50.00% | ±0.00% 0.00% |
| RowsBench | bench_merge_100_on_1k | 1 | 2 | 110.793mb +0.02% | 15.500μs +10.71% | ±3.23% +0.00% |
| RowsBench | bench_partition_by_on_1k | 1 | 2 | 110.873mb -0.01% | 1.966ms +23.14% | ±6.61% +80.46% |
| RowsBench | bench_schema_on_1k_identical_rows | 1 | 2 | 118.341mb -0.00% | 223.179ms +1.15% | ±0.42% +763.71% |
| RowsBench | bench_sort_asc_on_1k | 1 | 2 | 110.833mb +0.02% | 5.623ms +5.10% | ±3.10% +17.76% |
| RowsBench | bench_sort_by_on_1k | 1 | 2 | 110.852mb -0.01% | 5.740ms +8.91% | ±0.71% -48.07% |
| RowsBench | bench_sort_desc_on_1k | 1 | 2 | 110.819mb +0.04% | 5.545ms +9.52% | ±0.56% -57.75% |
| RowsBench | bench_sort_entries_on_1k | 1 | 2 | 111.647mb -0.01% | 5.471ms +6.65% | ±0.69% -77.82% |
| RowsBench | bench_unique_on_1k | 1 | 2 | 110.960mb -0.03% | 446.744ms +0.01% | ±0.92% +10.83% |
| TypeDetectorBench | bench_type_detector | 1 | 2 | 43.536mb -0.00% | 335.203ms -1.77% | ±0.23% -87.92% |
| TypeDetectorBench | bench_type_detector | 1 | 2 | 12.594mb -0.00% | 68.405ms -0.45% | ±0.13% -95.70% |
+-------------------+-----------------------------------+------+-----+------------------+-------------------+-----------------+
Parquet Library+--------------------+---------------------------------+------+-----+------------------+-------------------+-------------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+--------------------+---------------------------------+------+-----+------------------+-------------------+-------------------+
| ParquetWriterBench | bench_write_batch | 1 | 2 | 12.706mb -12.71% | 199.075ms -11.99% | ±0.59% +290.30% |
| ParquetWriterBench | bench_write_gzip | 1 | 2 | 11.366mb +0.01% | 227.103ms +2.96% | ±0.59% +2.42% |
| ParquetWriterBench | bench_write_row_by_row | 1 | 2 | 12.706mb -12.71% | 201.208ms -10.20% | ±0.36% +159.24% |
| ParquetWriterBench | bench_write_snappy | 1 | 2 | 12.706mb -12.71% | 196.978ms -13.14% | ±0.31% -5.29% |
| ParquetWriterBench | bench_write_uncompressed | 1 | 2 | 11.090mb +0.01% | 195.060ms +0.83% | ±0.20% -62.30% |
| ParquetReaderBench | bench_page_headers | 1 | 2 | 7.899mb -0.00% | 1.964s +4.49% | ±4.30% +571.31% |
| ParquetReaderBench | bench_read_metadata | 1 | 2 | 6.528mb -0.00% | 9.213ms +10.30% | ±9.15% +15187.67% |
| ParquetReaderBench | bench_read_schema | 1 | 2 | 6.528mb -0.00% | 8.502ms +3.21% | ±1.31% +357.65% |
| ParquetReaderBench | bench_read_values_all_columns | 1 | 2 | 10.105mb -0.19% | 5.628s -27.89% | ±0.59% +606.58% |
| ParquetReaderBench | bench_read_values_single_column | 1 | 2 | 7.402mb -0.26% | 215.881ms -51.88% | ±0.35% +20.78% |
| ParquetReaderBench | bench_read_values_with_limit | 1 | 2 | 7.929mb -0.39% | 19.344ms -16.80% | ±0.18% -52.73% |
+--------------------+---------------------------------+------+-----+------------------+-------------------+-------------------+
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #xxx
Change Log
Added
InvalidExplainConfigException- exception for invalid EXPLAIN config flag combinationsExplainConfigfluent builder methods:withAnalyze(),withoutAnalyze(),withBuffers(),withoutBuffers(),withTiming(),withoutTiming(),withVerbose(),withoutVerbose(),withCosts(),withoutCosts(),withMemory(),withoutMemory(),withSettings(),withoutSettings(),withSummary(),withoutSummary(),withWal(),withoutWal(),withFormat()ExplainConfigvalidation - throwsInvalidExplainConfigExceptionwhen BUFFERS, TIMING, or WAL are enabled without ANALYZEPlanSummary::fromArray()static factory method - creates instance from normalized array (inverse of normalize)ExplainConfigTest- unit tests for validation and fluent builder methodsPgSqlExplainTest- integration tests with data providers for ExplainConfig combinationsChanged
ExplainConfig::withoutAnalyze()auto-disables buffers, timing, and wal optionsFixed
ExplainModifiernow explicitly sets BUFFERS, TIMING, SUMMARY to OFF when disabled (PostgreSQL defaults could override user config)ExplainParser::parseBuffers()now detects Local Hit/Read Blocks for temporary tables