diff options
author | Oleg Smirnov <olernov@gmail.com> | 2023-01-02 14:46:46 +0700 |
---|---|---|
committer | Oleg Smirnov <olernov@gmail.com> | 2023-01-02 14:46:50 +0700 |
commit | 657ddf17491740f652f011458f03366e70c4728f (patch) | |
tree | b0d31279d3848424dab3a1260a59fcd2cebdc1b4 /sql/opt_range.h | |
parent | 92665b862b479f6582e3a15247bfc812e59e7e34 (diff) | |
download | mariadb-git-10.9-MDEV-16232.tar.gz |
MDEV-16232: Use fewer mini-transactions10.9-MDEV-16232
SQL Layer support #3.
Add checks of applicability for UPDATEs and DELETEs.
Rename "operations batch" to "mini transactions" to disambiguate
the term "batch" which is already used.
Temporary disable mini-transactions for SELECTs.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index f3ccd4d8311..22ddce91e96 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -1264,6 +1264,8 @@ public: This is used by an optimization in filesort. */ virtual void add_used_key_part_to_set()=0; + + virtual bool are_mini_transactions_applicable() const= 0; }; @@ -1361,6 +1363,8 @@ public: QUICK_SELECT_I *make_reverse(uint used_key_parts_arg); virtual void add_used_key_part_to_set(); + bool are_mini_transactions_applicable() const override + { return !in_ror_merged_scan && !mrr_flags; } private: /* Default copy ctor used by QUICK_SELECT_DESC */ @@ -1398,7 +1402,6 @@ private: }; - class QUICK_RANGE_SELECT_GEOM: public QUICK_RANGE_SELECT { public: @@ -1531,6 +1534,7 @@ public: READ_RECORD read_record; virtual void add_used_key_part_to_set(); + bool are_mini_transactions_applicable() const override { return false; } }; @@ -1642,6 +1646,8 @@ public: return valid; } + bool are_mini_transactions_applicable() const override { return false; } + /* Merged quick select that uses Clustered PK, if there is one. This quick select is not used for row retrieval, it is used for row retrieval. @@ -1710,6 +1716,8 @@ public: return valid; } + bool are_mini_transactions_applicable() const override { return false; } + QUEUE queue; /* Priority queue for merge operation */ MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */ @@ -1836,6 +1844,7 @@ public: bool is_agg_distinct() { return have_agg_distinct; } bool loose_scan_is_scanning() { return is_index_scan; } Explain_quick_select *get_explain(MEM_ROOT *alloc); + bool are_mini_transactions_applicable() const override { return true; } }; |