Merged PRs
dolt
- 12203: nbs: deduplicate archive dictionaries by content
Fix #12177 - 12198: Build virtual merge bases in UTC
Column defaults that read the time, like CURRENT_TIMESTAMP, give it in the session's time zone, so a virtual merge base built with a non-deterministic timestamp. This matters becausedolt_merge_basesorders by time stamp. Since no one
actually sees the virtual commit, we'll build it with the session time zone set to UTC, and restore the session's own afterwards. - 12194: nbs: allocate chunk journal write buffers and index maps on demand
- Lazily allocate
journalWriter.bufon write and retain a 64 KB baseline (journalWriterMinBuffSize) across flushes to minimize idle journal footprint while preventing allocation churn. - Initialize
rangeIndex.novelwith zero initial capacity to eliminate static map overhead and scale lookup memory strictly with indexed chunks. - Add cross-platform
get_memory_kbbats helper to get PID memory usage.
Fix #12179
- Lazily allocate
go-mysql-server
- 4062: Do not hoist filters out of the null side of a lateral join
fixes #11552
hoistOutOfScopeFilterspulls filters that only reference an outer scope out of a derived table. for a lateral derived table on the right of a join that's wrong: inLEFT JOIN LATERAL (SELECT o.id + 1 AS tag WHERE o.id = 1) AS q ON TRUEtheo.id = 1filter decides whetherqhas a row for thato, it shouldn't filteroitself. at the top level there was nothing to hoist it into, so the query failed withrule 'hoistOutOfScopeFilters' tried to hoist filters above root node. hoisted filters from a derived table that is a non-preserved child of a join (IsPreservedTable) now stay inside it as a filter. derived tables insideEXISTSandINsubqueries aren't join children like that, so they still get hoisted as before.
the new script inSubqueriesScriptTestscovers the query from the issue, the same thing with an innerJOIN LATERAL, and aLEFT JOIN LATERALover a table that mixes an inner and an outer filter. all three failed with the error above and pass now, and i checked the expected results against mysql 8.4. the rest of./sql/...and./enginetest/...has the same results as main under-tags gms_pure_go. - 4059: Apply sql_select_limit to simple selects and DISTINCT
fixes #11549
a non-defaultsql_select_limitwas ignored in two places. the simple-select batch ingetBatchesForNode(aProjectover aResolvedTable, with or without aFilter) did not runapplyDefaultSelectLimit, soset @@sql_select_limit = 2followed byselect * from torselect x from t where y > 1returned every row. the rule now runs in that batch too. separately,applyLimitdid not handle aDistinctroot, which is what the query from the issue plans to:an explicitselect distinct row_number() over (order by x) as rn from t order by rn;
LIMITis still planned above theDistinct, so it keeps taking precedence over the session limit. - 4058: execute multiple statements in stored procedure exit handlers
Currently, the stored procedure handler logic assumes there is exactly one statement for exit handlers.
This PR fixes the handler to execute all the queries within a stored procedure handler.
However, like other parts of the stored procedure logic, the result set is discarded.
Related: - 4057: Skip costed index scan for non
MATCH...AGAINSTfilters on fulltext indexes
fixes #12175
Costed index scans should only work on full text indexes with aMATCH...AGAINSTfilter. However, we should not be erroring out when the filter is not aMATCH...AGAINST; the filter should instead work like a regular filter.
This PR removes emitting an error when a nonMATCH...AGAINSTfilter is on a fulltext index. It also skips calculating the cost in the first place for fulltext indexes with nonMATCH...AGAINSTfilters. - 4056: Fix accidentally dropping filters in complex joins
Dolt PR: #12193
The join order planner did not properly check that all joins were actually included in the new plan. This PR fixes that.
There's potential room for improvement here, both in detecting when filters are redundant and what to do when the current join order planning fails. But this fixes a potential correctness issue. - 4054: create larger decimal precision during comparisons
We were choosing the wrong decimal scale/precision when comparing column decimals against literals.
Fixes #12185 - 4047: Fix type coercision for
GREATESTandLEASTfunctions
This PR fixes the resulting and comparing types forGREATESTandLEASTfunctions to more closely follow MySQL. Combinations of types result in string type output, which we defaulted toDOUBLEin many cases. The presence of DATE/DATETIME/TIMESTAMP types causes other types to be converted and compared as the corresponding temporal type, and then converted to the appropriate output type (usually string).
Passing Dolt bump: #12187
Closed Issues
- 11548: Dolt mis-evaluates a correlated anti-join over a derived ROW_NUMBER() result
- 11552: Dolt reaches an analyzer internal error for a legal correlated LEFT JOIN LATERAL
- 11549: Dolt drops sql_select_limit
- 12177: DOLT_GC duplicates archive dictionaries once an archive has more than 256, pinning ~137 KB of C memory per duplicate
- 12175: Full-Text index is selected for ordinary equality and IS NULL filters, causing unknown expression errors
- 12185: DECIMAL comparison precision against literals isn't converted correctly
- 12179: sql-server holds about 7.3 MB of memory per open database (chunk journal buffers), limiting how many databases one server can hold
- 12050: Merge and three-dot diff use only the tallest of several merge bases, which breaks the schema-branch pattern
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.3 | 0.14 |
| groupby_scan | 132.49 | 65.65 | 0.5 |
| index_join | 3.43 | 1.96 | 0.57 |
| index_join_scan | 4.1 | 1.3 | 0.32 |
| index_scan | 344.08 | 186.54 | 0.54 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 4.91 | 1.36 |
| select_random_points | 0.36 | 0.51 | 1.42 |
| select_random_ranges | 0.38 | 0.62 | 1.63 |
| table_scan | 344.08 | 186.54 | 0.54 |
| types_table_scan | 733.0 | 427.07 | 0.58 |
| reads_mean_multiplier | 0.81 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 4.03 | 0.52 |
| oltp_insert | 4.03 | 2.07 | 0.51 |
| oltp_read_write | 8.74 | 10.09 | 1.15 |
| oltp_update_index | 4.33 | 2.22 | 0.51 |
| oltp_update_non_index | 4.03 | 1.93 | 0.48 |
| oltp_write_only | 5.18 | 5.0 | 0.97 |
| types_delete_insert | 8.28 | 4.49 | 0.54 |
| writes_mean_multiplier | 0.67 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 97.69 | 57.79 | 1.69 |
| tpcc_tps_multiplier | 1.69 |
| Overall Mean Multiple | 1.06 |
|---|