summaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/cbo
Commit message (Collapse)AuthorAgeFilesLines
* Replace unreachable with *_ENSURE(false, ...)atarasov52026-04-012-7/+8
| | | | commit_hash:7c1445375e838a9327006528cb455c9899e9b32d
* YQL-20095: Enable readability-avoid-const-params-in-declsvitya-smirnov2026-03-311-7/+7
| | | | | https://clang.llvm.org/extra/clang-tidy/checks/readability/avoid-const-params-in-decls.html commit_hash:17e1ec5c3849a38bcb76cd4927e66979bee6c2ec
* YQL-20095: Enable modernize-use-designated-initializersvitya-smirnov2026-03-172-11/+11
| | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-designated-initializers.html commit_hash:d73eb463c7bec2bda4c362aab10af49979a7ddd3
* [CBO] Fix interesting orderings lookup: make it order-sensitive, i.e. ↵alexpaniman2026-03-172-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shuffle [A, B] != [B, A] # Description for reviewers Interesting orderings FSM, considers shuffles "not natural" (before this PR), i.e. the order doesn't matter. Since our hash function is order-depended this leads to correctness bugs. For example, this SQL query: ```sql $semi_join = ( SELECT * FROM customer c LEFT SEMI JOIN oorder o ON c.C_W_ID = o.O_W_ID AND c.C_D_ID = o.O_D_ID ); SELECT s.C_W_ID, s.C_D_ID, n.NO_O_ID FROM $semi_join s INNER JOIN new_order as n ON s.C_W_ID = n.NO_W_ID AND s.C_D_ID = n.NO_D_ID; ``` Used to produce this plan: ``` ┌> ResultSet └─┬> InnerJoin (Grace) (c.C_D_ID,c.C_W_ID = n.NO_D_ID,n.NO_W_ID) ├─┬> LeftSemiJoin (Grace) (c.C_D_ID,c.C_W_ID = o.O_W_ID,o.O_D_ID) │ ├─┬> HashShuffle (KeyColumns: ["C_W_ID","C_D_ID"], HashFunc: "HashV2") │ │ └──> TableFullScan (Table: customer, ReadColumns: ["C_W_ID (-∞, +∞)","C_D_ID (-∞, +∞)","C_ID (-∞, +∞)"]) │ └─┬> HashShuffle (KeyColumns: ["O_W_ID","O_D_ID"], HashFunc: "HashV2") │ └──> TableFullScan (Table: oorder, ReadColumns: ["O_W_ID (-∞, +∞)","O_D_ID (-∞, +∞)","O_ID (-∞, +∞)"]) └─┬> HashShuffle (KeyColumns: ["NO_W_ID","NO_D_ID"], HashFunc: "HashV2") └──> TableFullScan (Table: new_order, ReadColumns: ["NO_W_ID (-∞, +∞)","NO_D_ID (-∞, +∞)","NO_O_ID (-∞, +∞)"]) ``` This plan is wrong, because InnerJoin reuses \[C\_W\_ID, C\_D\_ID\] shuffle, when it really needs \[C\_D\_ID, C\_W\_ID\] - this will lead to incorrect result if executed on more than 1 node with overwhelming probability. After this PR, it produces a correct plan ``` ┌> ResultSet └─┬> InnerJoin (Grace) (c.C_D_ID,c.C_W_ID = n.NO_D_ID,n.NO_W_ID) ├─┬> HashShuffle (KeyColumns: ["c.C_D_ID","c.C_W_ID"], HashFunc: "HashV2") │ └─┬> LeftSemiJoin (Grace) (c.C_D_ID,c.C_W_ID = o.O_W_ID,o.O_D_ID) │ ├─┬> HashShuffle (KeyColumns: ["C_W_ID","C_D_ID"], HashFunc: "HashV2") │ │ └──> TableFullScan (Table: customer, ReadColumns: ["C_W_ID (-∞, +∞)","C_D_ID (-∞, +∞)","C_ID (-∞, +∞)"]) │ └─┬> HashShuffle (KeyColumns: ["O_W_ID","O_D_ID"], HashFunc: "HashV2") │ └──> TableFullScan (Table: oorder, ReadColumns: ["O_W_ID (-∞, +∞)","O_D_ID (-∞, +∞)","O_ID (-∞, +∞)"]) └─┬> HashShuffle (KeyColumns: ["NO_D_ID","NO_W_ID"], HashFunc: "HashV2") └──> TableFullScan (Table: new_order, ReadColumns: ["NO_W_ID (-∞, +∞)","NO_D_ID (-∞, +∞)","NO_O_ID (-∞, +∞)"]) ``` This mirrors PR made on github: <https://github.com/ydb-platform/ydb/pull/35609> # Changelog entry Type: fix Component: CBO Make interesting orderings order-sensitive commit_hash:2d8e98048cb669bfc7048a227a8b42504664a273
* YQL-20095: Enable modernize-use-bool-literalsvitya-smirnov2026-03-032-11/+11
| | | | commit_hash:05fdc8e01569c5d74e2840a310ed1f7a34b72374
* YQL-20095: Enable modernize-pass-by-valuevitya-smirnov2026-03-022-3/+5
| | | | commit_hash:4939dfad654f18bb31e40711ee0c39063889f17b
* YQL-20095: Enable modernize-loop-convertvitya-smirnov2026-02-272-7/+7
| | | | | | | | - https://clang.llvm.org/extra/clang-tidy/checks/modernize/loop-convert.html Semi-automatic translation was performed. Manually rewritten some types and names. commit_hash:0ad921f0d512dd4a8ccc8af557197ce6a02582e1
* YQL-20095: Enable google-explicit-constructorvitya-smirnov2026-01-233-7/+7
| | | | commit_hash:4d77ad10fd4db303459ec4e45e139967c7fc8196
* YQL-20095: Enable modernize-use-overridevitya-smirnov2026-01-132-6/+6
| | | | | | | | | | | | | | | | | | | The check `modernize-use-override` is useful as it: 1. Removes redundant `override` when it is used with a `final`. 2. Removes redundant `virtual` or replace it with a `override`. So it is more clean for a reader, that overriding happens. It is enabled not out of order, as it is just an alias to `cppcoreguidelines-explicit-virtual-functions`. I also decided to switch a strategy of enabling checks. Now I will enable only a single rule with a single PR and prefer rules with a non-breaking autofix. In the new year with new linter checks! 🎄 commit_hash:e6e233baa90b31e5f65e11837546690c47f71ab5
* YQL-20086: Add yql/essentials Clang Tidy configvitya-smirnov2025-11-214-32/+36
| | | | | | | | | This patch introduces an extension configuration for the Clang Tidy. It is merged with Arcadia Clang Tidy configuration. To begin with, more checks for identifiers naming are added. Documentation: https://nda.ya.ru/t/AhbDZbiF7MKe3M. commit_hash:3481da4c8df0a4d23a991d4a660ae050d2dc5d33
* Replace ForceShuffleElimination with more flexible cutoffalexpaniman2025-11-121-1/+1
| | | | | | | I merged "ForceShuffleElimination" parameter. It's been decided that it's better to use a more flexible "cutoff" parameter which enables ShuffleElimination optimization based on number of joins, not just with on/off switch. This PR updates this. After it's merged files in yql/essential will match corresponding files in the PR to YDB at github <https://github.com/ydb-platform/ydb/pull/27065>. Previously merged PR concerning the same github PR: <https://nda.ya.ru/t/UxEq690V7MqMWj> commit_hash:26ed62335263ad4c8e536a1079088fdcdbf09676
* Add CBO parameter for configuring Shuffle Elimination cutoffalexpaniman2025-11-112-5/+7
| | | | | Adds configurable Shuffle Elimination cutoff option based on number of joins in a query. This option is primarily needed for benchmarking CBO with Shuffle Elimination on different queries, PR with benchmarks is going to be to merged at github <https://github.com/ydb-platform/ydb/pull/27065>, but since it also changes yql/essentials, this PR on Arcanum needs to be merged first. commit_hash:5ca0bbf08f8ec4c370cba0cf2e4034e4a90d3cdf
* YQL-20086 invert flagvvvv2025-10-103-6/+0
| | | | commit_hash:a6b640bc576263b62884a0b4187ba79c893e13d9
* YQL-20086 core (part1)vvvv2025-10-0810-381/+340
| | | | commit_hash:12dbda4defcaef8dd708a69552fc19eba832ce2f
* [RBO] Added to FSM commentspudge1000-72025-08-141-7/+41
| | | | commit_hash:aa4a8f9f4324bdcdc2270bcf95210c61a3ab5a0f
* [RBO] Sorting ordering bug fixpudge1000-72025-08-111-1/+1
| | | | | | | | | | | | | без данной проблемы планы становятся невалидными все последовательности с одинаковыми ключами воспринимаются как одна если это не natural ордеринг (0, 1) == (1, 0) с сортировками такое свойство не работает поэтому я поставил true isNatural для поиска сортировок без такого при поиске сортировки (0, 1) может быть найдена (1, 0) и (0, 1) не natural для не шаффлов не актуальны commit_hash:393d67fc9351b4d55cebb1c4626a0bff67f19b9f
* [CBO] Added natural orderings to the orderings FSMpudge1000-72025-07-112-23/+139
| | | | commit_hash:0c2ffe1e39a68fb428693a44740912efd911df53
* [CBO] Add Bytes hintspudge1000-72025-07-073-8/+70
| | | | commit_hash:5b4543a711fae95d2b84490c37ff427fabae3e32
* [RBO] Improved Sortings FSMpudge1000-72025-06-192-19/+60
| | | | commit_hash:3077f1e2a744069524dc6723bca2fbdbb92ae2ba
* YQL-20086 corevvvv2025-06-183-231/+231
| | | | commit_hash:af5d81d51befa5cee331fbed69e7e5db2014a260
* [RBO] Improved FSM with sortings (added directions)pudge1000-72025-06-093-50/+265
| | | | commit_hash:9231a4622fddb446383422832d990f02e9380055
* [RBO] Added Sortings to FSMpudge1000-72025-05-302-111/+386
| | | | commit_hash:31f620a0fe2951e9096dfddcb3ceef3c40b10d85
* [CBO] Add DFSM checkpudge1000-72025-05-221-2/+5
| | | | commit_hash:561f58ec032441ef31ac90422f1e9d4bbaae08e8
* [CBO] Extended interesting ordering frameworkpudge1000-72025-05-143-431/+951
| | | | commit_hash:8be8e760441be23282adde68efb8c20870a3086e
* [CBO] Ternary Operator bytesize estimation bug fixpudge1000-72025-03-171-2/+3
| | | | commit_hash:bbd0d872026fdf22126ee6b34643a9c8af506983
* [CBO] Anti/Semi Join costs and nrows fixespudge1000-72025-03-051-6/+11
| | | | commit_hash:7b539419792cc32df00ac3bbacb62544fecaa9e9
* [CBO] Add CROSS JOIN cost fixpudge1000-72025-02-261-0/+4
| | | | commit_hash:ea1e4e327107df922cd5525ae33646992addafda
* [CBO] Shuffle cost addedpudge1000-72025-02-243-36/+89
| | | | commit_hash:b3a5db770659cba2a0c2329b54da2f1445a3284e
* [CBO] Added interesting orderings frameworkpudge1000-72025-02-201-0/+679
| | | | commit_hash:9ee882d80e40a0290a6ff9680dc5e7e3b3572492
* [CBO] Make hints parser parse better (added _ handling + lowercase join algo).pudge1000-72024-12-191-13/+26
| | | | commit_hash:eb8da1509d0bd5d5a2be2b7d701dc3f4f58a4a92
* Fix YT provider direct dependency on DQ via CBOaneporada2024-11-265-7/+83
| | | | commit_hash:134201d428f9541bb6990e2d65a7bbcf65d74e25
* Moved other yql/essentials libs YQL-19206vvvv2024-11-071-2/+2
| | | | | init commit_hash:7d4c435602078407bbf20dd3c32f9c90d2bbcbc0
* Prepare move yql/minikql YQL-19206vvvv2024-11-076-0/+1065
types,jsonpath,dom commit_hash:6b54be5968b6a30b6d97fe3a1611574bcefc749e