summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2023-01-10 15:37:28 +0200
committerMonty <monty@mariadb.org>2023-02-10 12:59:36 +0200
commit3316a54db3df9b50596cceab5164af5ef74efabd (patch)
treecff4ffc7ada574bc462defb6d121e8dc986cbf05 /sql/sql_select.h
parent65da5645305ee3b5d49c571314b832059bace09c (diff)
downloadmariadb-git-3316a54db3df9b50596cceab5164af5ef74efabd.tar.gz
Code cleanups and add some caching of functions to speed up things
Detailed description: - Added more function comments and fixed types in some old comments - Removed an outdated comment - Cleaned up some functions in records.cc - Replaced "while" with "if" - Reused error code - Made functions similar - Added caching of pfs_batch_update() - Simplified some rowid_filter code - Only call build_range_rowid_filter() if rowid filter will be used - Replaced tab->is_rowid_filter_built with need_to_build_rowid_filter. We only have to test need_to_build_rowid_filter to know if we have to build the filter. Old code needed two tests - Added function 'clear_range_rowid_filter' to disable rowid filter. Made things simpler as we can now clear all rowid filter variables in one place. - Removed some 'if' in sub_select()
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 73e8739f960..4b64243e1c9 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -423,6 +423,8 @@ typedef struct st_join_table {
bool cached_eq_ref_table,eq_ref_table;
bool shortcut_for_distinct;
bool sorted;
+ bool cached_pfs_batch_update;
+
/*
If it's not 0 the number stored this field indicates that the index
scan has been chosen to access the table data and we expect to scan
@@ -571,10 +573,11 @@ typedef struct st_join_table {
Range_rowid_filter_cost_info *range_rowid_filter_info;
/* Rowid filter to be used when joining this join table */
Rowid_filter *rowid_filter;
- /* Becomes true just after the used range filter has been built / filled */
- bool is_rowid_filter_built;
+ /* True if the plan requires a rowid filter and it's not built yet */
+ bool need_to_build_rowid_filter;
- void build_range_rowid_filter_if_needed();
+ void build_range_rowid_filter();
+ void clear_range_rowid_filter();
void cleanup();
inline bool is_using_loose_index_scan()
@@ -685,7 +688,7 @@ typedef struct st_join_table {
double get_examined_rows();
bool preread_init();
- bool pfs_batch_update(JOIN *join);
+ bool pfs_batch_update();
bool is_sjm_nest() { return MY_TEST(bush_children); }