-
-
Notifications
You must be signed in to change notification settings - Fork 48
feature: postgresql plan summary #2133
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: sql_to_limited_query(string $sql, int $limit) DSL function - adds LIMIT clause to queries without adding OFFSET - added: PlanSummary::normalize() method - returns all plan summary fields as snake_case keyed array - added: PlanSummary memory statistics: memoryUsed, memoryPeak - added: PlanSummary join statistics: hashJoinCount, nestedLoopCount, mergeJoinCount - added: PlanSummary buffer statistics: totalSharedHit, totalSharedRead, hasTempSpill - added: PlanSummary row statistics: estimatedRows, actualRows - added: LimitedQueryTest - 7 test cases for sql_to_limited_query function - added: PlanSummaryTest - 3 test cases for PlanSummary::normalize() method - changed: PlanAnalyzer::summary() now computes and passes join counts, buffer statistics, and row data to PlanSummary
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 1.x #2133 +/- ##
==========================================
+ Coverage 82.86% 83.13% +0.26%
==========================================
Files 1177 1177
Lines 41699 41743 +44
==========================================
+ Hits 34554 34703 +149
+ Misses 7145 7040 -105
🚀 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.008mb +0.03% | 324.025ms -5.41% | ±0.33% +35.36% |
| DbalExtractorBench | bench_extract_10k_keyset | 1 | 2 | 41.604mb +0.01% | 264.776ms +4.88% | ±1.69% -40.24% |
| DbalExtractorBench | bench_extract_10k_limit_offset | 1 | 2 | 41.604mb -0.01% | 212.650ms -4.49% | ±1.03% -87.51% |
| ExcelExtractorBench | bench_extract_10k_ods | 1 | 2 | 67.139mb +0.00% | 982.584ms +0.92% | ±2.36% +96.38% |
| ExcelExtractorBench | bench_extract_10k_xlsx | 1 | 2 | 67.936mb +0.00% | 1.633s -0.74% | ±0.68% -41.03% |
| JsonExtractorBench | bench_extract_10k | 1 | 2 | 6.668mb +0.03% | 1.149s +0.95% | ±0.23% -27.51% |
| ParquetExtractorBench | bench_extract_10k | 1 | 2 | 11.853mb -0.70% | 10.011s -20.01% | ±0.13% -47.64% |
| PostgreSqlExtractorBench | bench_extract_10k_cursor | 1 | 2 | 43.290mb -0.02% | 260.354ms -0.95% | ±0.58% -74.25% |
| PostgreSqlExtractorBench | bench_extract_10k_keyset | 1 | 2 | 43.291mb -0.01% | 447.143ms +0.65% | ±0.15% -65.67% |
| PostgreSqlExtractorBench | bench_extract_10k_limit_offset | 1 | 2 | 43.292mb -0.00% | 408.744ms +2.29% | ±1.42% +110.03% |
| TextExtractorBench | bench_extract_10k | 1 | 2 | 5.998mb +0.03% | 58.904ms -3.02% | ±0.11% -94.81% |
| XmlExtractorBench | bench_extract_10k | 1 | 2 | 6.018mb +0.03% | 665.130ms +0.05% | ±0.78% -41.82% |
+--------------------------+--------------------------------+------+-----+-----------------+------------------+-----------------+
Transformers+---------------------------------+--------------------------+------+-----+------------------+-----------------+------------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+------------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1 | 2 | 182.063mb +0.00% | 90.962ms -0.65% | ±0.89% +611.56% |
| RenameEachEntryTransformerBench | bench_transform_10k_rows | 1 | 2 | 26.798mb +0.01% | 79.100ms +2.65% | ±2.09% +1642.47% |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+------------------+
Loaders+-----------------------+---------------------+------+-----+------------------+------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-----------------------+---------------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench | bench_load_10k | 1 | 2 | 102.098mb -0.00% | 111.478ms -3.09% | ±1.44% +57.11% |
| DbalLoaderBench | bench_load_10k | 1 | 2 | 108.483mb -0.01% | 420.856ms -3.65% | ±1.94% -34.16% |
| ExcelLoaderBench | bench_load_10k_ods | 1 | 2 | 102.532mb +0.01% | 267.462ms -2.07% | ±0.44% -66.53% |
| ExcelLoaderBench | bench_load_10k_xlsx | 1 | 2 | 102.716mb +0.02% | 279.391ms +1.83% | ±1.59% +183.83% |
| JsonLoaderBench | bench_load_10k | 1 | 2 | 102.093mb +0.00% | 97.536ms +0.01% | ±0.92% -26.06% |
| ParquetLoaderBench | bench_load_10k | 1 | 2 | 137.522mb -5.42% | 2.135s -13.54% | ±0.09% +12.81% |
| PostgreSqlLoaderBench | bench_load_10k | 1 | 2 | 110.177mb -0.01% | 382.033ms -0.53% | ±0.55% +26.24% |
| TextLoaderBench | bench_load_10k | 1 | 2 | 107.237mb +0.03% | 33.619ms -0.56% | ±0.82% -32.63% |
+-----------------------+---------------------+------+-----+------------------+------------------+-----------------+
Building Blocks+-------------------+-----------------------------------+------+-----+------------------+-------------------+------------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+-------------------+-----------------------------------+------+-----+------------------+-------------------+------------------+
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 127.834mb +0.00% | 572.944ms -0.89% | ±0.39% -87.14% |
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 67.014mb +0.00% | 298.114ms +2.70% | ±1.42% +194.42% |
| EntryFactoryBench | bench_entry_factory | 1 | 2 | 18.103mb +0.01% | 63.918ms +0.60% | ±0.51% -57.90% |
| RowsBench | bench_chunk_1_000_on_10k | 1 | 2 | 110.999mb +0.01% | 278.000μs +26.08% | ±0.36% -87.80% |
| RowsBench | bench_diff_left_100_on_1k | 1 | 2 | 110.968mb +0.00% | 82.908ms -2.08% | ±0.00% -99.02% |
| RowsBench | bench_diff_right_100_on_1k | 1 | 2 | 110.826mb +0.04% | 77.205ms -2.74% | ±0.78% -81.02% |
| RowsBench | bench_drop_100_on_1k | 1 | 2 | 110.820mb +0.00% | 16.000μs +0.00% | ±0.00% -100.00% |
| RowsBench | bench_drop_right_10_on_1k | 1 | 2 | 110.797mb +0.01% | 17.500μs +9.38% | ±2.86% +0.00% |
| RowsBench | bench_entries_on_1k | 1 | 2 | 110.773mb +0.04% | 75.500μs +38.53% | ±4.64% -27.81% |
| RowsBench | bench_filter_on_1k | 1 | 2 | 110.780mb +0.02% | 338.059μs +14.40% | ±8.88% +949.11% |
| RowsBench | bench_find_on_1k | 1 | 2 | 110.780mb -0.01% | 349.029μs +20.35% | ±4.30% +523.21% |
| RowsBench | bench_find_one_on_1k | 1 | 2 | 110.818mb -0.05% | 309.481μs +4.55% | ±3.07% -17.40% |
| RowsBench | bench_first_on_1k | 1 | 2 | 110.804mb -0.02% | 3.000μs +200.00% | ±0.00% 0.00% |
| RowsBench | bench_merge_100_on_1k | 1 | 2 | 110.804mb +0.02% | 13.500μs 0.00% | ±3.70% 0.00% |
| RowsBench | bench_partition_by_on_1k | 1 | 2 | 110.865mb -0.00% | 1.530ms +4.14% | ±5.62% +1964.28% |
| RowsBench | bench_schema_on_1k_identical_rows | 1 | 2 | 118.332mb +0.01% | 218.261ms -1.49% | ±0.05% -92.46% |
| RowsBench | bench_sort_asc_on_1k | 1 | 2 | 110.828mb +0.01% | 5.105ms +2.92% | ±0.42% -75.57% |
| RowsBench | bench_sort_by_on_1k | 1 | 2 | 110.815mb +0.02% | 4.970ms +0.24% | ±0.12% -73.98% |
| RowsBench | bench_sort_desc_on_1k | 1 | 2 | 110.809mb +0.03% | 5.002ms +0.03% | ±0.42% -45.47% |
| RowsBench | bench_sort_entries_on_1k | 1 | 2 | 111.657mb -0.02% | 4.958ms -0.81% | ±0.26% +773.75% |
| RowsBench | bench_unique_on_1k | 1 | 2 | 110.917mb +0.03% | 443.900ms +0.02% | ±1.08% +455.44% |
| TypeDetectorBench | bench_type_detector | 1 | 2 | 43.534mb +0.00% | 339.472ms +2.34% | ±0.96% -15.48% |
| TypeDetectorBench | bench_type_detector | 1 | 2 | 12.591mb +0.01% | 67.325ms -0.12% | ±0.23% -84.80% |
+-------------------+-----------------------------------+------+-----+------------------+-------------------+------------------+
Parquet Library+--------------------+---------------------------------+------+-----+------------------+-------------------+-----------------+
| benchmark | subject | revs | its | mem_peak | mode | rstdev |
+--------------------+---------------------------------+------+-----+------------------+-------------------+-----------------+
| ParquetWriterBench | bench_write_batch | 1 | 2 | 12.704mb -12.69% | 194.462ms -12.57% | ±0.95% +48.38% |
| ParquetWriterBench | bench_write_gzip | 1 | 2 | 11.363mb +0.03% | 218.722ms +0.70% | ±0.49% -44.39% |
| ParquetWriterBench | bench_write_row_by_row | 1 | 2 | 12.704mb -12.69% | 191.483ms -13.94% | ±0.04% -94.37% |
| ParquetWriterBench | bench_write_snappy | 1 | 2 | 12.704mb -12.69% | 191.981ms -14.52% | ±1.50% +41.90% |
| ParquetWriterBench | bench_write_uncompressed | 1 | 2 | 11.088mb +0.03% | 192.572ms +1.95% | ±0.30% +114.76% |
| ParquetReaderBench | bench_page_headers | 1 | 2 | 7.896mb +0.02% | 1.875s +1.33% | ±0.32% +3.82% |
| ParquetReaderBench | bench_read_metadata | 1 | 2 | 6.526mb +0.03% | 8.123ms -0.76% | ±0.23% -49.62% |
| ParquetReaderBench | bench_read_schema | 1 | 2 | 6.526mb +0.03% | 8.146ms -1.85% | ±0.02% -98.48% |
| ParquetReaderBench | bench_read_values_all_columns | 1 | 2 | 10.102mb -0.17% | 5.570s -28.79% | ±0.64% +96.31% |
| ParquetReaderBench | bench_read_values_single_column | 1 | 2 | 7.399mb -0.23% | 210.938ms -52.63% | ±0.11% +470.89% |
| ParquetReaderBench | bench_read_values_with_limit | 1 | 2 | 7.926mb -0.37% | 18.545ms -20.52% | ±0.32% +64.12% |
+--------------------+---------------------------------+------+-----+------------------+-------------------+-----------------+
|
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
sql_to_limited_query(string $sql, int $limit)DSL function - adds LIMIT clause to queries without adding OFFSETPlanSummary::normalize()method - returns all plan summary fields as snake_case keyed arrayPlanSummarymemory statistics:memoryUsed,memoryPeakPlanSummaryjoin statistics:hashJoinCount,nestedLoopCount,mergeJoinCountPlanSummarybuffer statistics:totalSharedHit,totalSharedRead,hasTempSpillPlanSummaryrow statistics:estimatedRows,actualRowsLimitedQueryTest- 7 test cases for sql_to_limited_query functionPlanSummaryTest- 3 test cases for PlanSummary::normalize() methodChanged
PlanAnalyzer::summary()now computes and passes join counts, buffer statistics, and row data to PlanSummary