Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f93b0bbe
Commit
f93b0bbe
authored
Feb 18, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MWL#90: subquery optimizations
- Remove redundant changes againist 5.3-main
parent
9482a2cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
47 deletions
+15
-47
sql/item_subselect.cc
sql/item_subselect.cc
+4
-4
sql/sql_base.cc
sql/sql_base.cc
+1
-0
sql/sql_class.cc
sql/sql_class.cc
+2
-1
sql/sql_join_cache.cc
sql/sql_join_cache.cc
+1
-32
sql/sql_select.cc
sql/sql_select.cc
+5
-7
sql/sql_select.h
sql/sql_select.h
+2
-3
No files found.
sql/item_subselect.cc
View file @
f93b0bbe
...
...
@@ -3587,7 +3587,7 @@ subselect_hash_sj_engine::get_strategy_using_schema()
bitmap_set_bit
(
&
partial_match_key_parts
,
i
);
++
count_partial_match_columns
;
}
}
;
}
}
/* If no column contains NULLs use regular hash index lookups. */
...
...
@@ -3787,7 +3787,8 @@ bitmap_init_memroot(MY_BITMAP *map, uint n_bits, MEM_ROOT *mem_root)
reexecution.
@param tmp_columns the items that produce the data for the temp table
@param subquery_id subquery's identifier (for temptable name)
@param subquery_id subquery's identifier (to make "<subquery%d>" name for
EXPLAIN)
@details
- Create a temporary table to store the result of the IN subquery. The
...
...
@@ -3998,7 +3999,6 @@ subselect_hash_sj_engine::make_unique_engine()
tab
->
table
=
tmp_table
;
tab
->
ref
.
tmp_table_index_lookup_init
(
thd
,
tmp_key
,
it
,
FALSE
);
DBUG_RETURN
(
new
subselect_uniquesubquery_engine
(
thd
,
tab
,
item
,
semi_join_conds
));
}
...
...
sql/sql_base.cc
View file @
f93b0bbe
...
...
@@ -7788,6 +7788,7 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
}
DBUG_ASSERT
(
item
==
table_list
->
jtbm_subselect
);
table_list
->
jtbm_subselect
->
setup_engine
(
FALSE
);
//psergey-merge: ^ todo: error checking!
}
}
...
...
sql/sql_class.cc
View file @
f93b0bbe
...
...
@@ -3033,7 +3033,8 @@ bool select_dumpvar::send_eof()
}
bool
select_materialize_with_stats
::
bool
select_materialize_with_stats
::
create_result_table
(
THD
*
thd_arg
,
List
<
Item
>
*
column_types
,
bool
is_union_distinct
,
ulonglong
options
,
const
char
*
table_alias
,
bool
bit_fields_as_long
)
...
...
sql/sql_join_cache.cc
View file @
f93b0bbe
...
...
@@ -1061,7 +1061,6 @@ int JOIN_CACHE::realloc_buffer()
*/
int
JOIN_CACHE
::
init
()
//psergey-merge:wtf is this here: for (tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, TRUE))
{
DBUG_ENTER
(
"JOIN_CACHE::init"
);
...
...
@@ -3260,23 +3259,7 @@ uint JOIN_CACHE_HASHED::get_next_key(uchar ** key)
int
JOIN_TAB_SCAN
::
open
()
{
//psergey-merge: todo: check the below:
//JOIN_TAB *bound= join_tab-cache->tables;
#if 0
JOIN_TAB *bound= cache->start_tab;
// psergey-todo-merge: can we really iterate backwards?
// Q: is there really a need to iterate backwards?
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
{
tab->status= tab->table->status;
tab->table->status= 0;
}
#endif
save_or_restore_used_tabs
(
join_tab
,
FALSE
);
is_first_record
=
TRUE
;
return
join_init_read_record
(
join_tab
);
}
...
...
@@ -3381,11 +3364,6 @@ void save_or_restore_used_tabs(JOIN_TAB *join_tab, bool save)
void
JOIN_TAB_SCAN
::
close
()
{
#if 0
JOIN_TAB *bound= join_tab - cache->tables;
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
tab->table->status= tab->status;
#endif
save_or_restore_used_tabs
(
join_tab
,
TRUE
);
}
...
...
@@ -3786,15 +3764,6 @@ int JOIN_TAB_SCAN_MRR::open()
/* Dynamic range access is never used with BKA */
DBUG_ASSERT
(
join_tab
->
use_quick
!=
2
);
/*
psergey-merge: done?
JOIN_TAB *bound= join_tab - cache->tables;
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
{
tab->status= tab->table->status;
tab->table->status= 0;
}
*/
save_or_restore_used_tabs
(
join_tab
,
FALSE
);
init_mrr_buff
();
...
...
sql/sql_select.cc
View file @
f93b0bbe
...
...
@@ -2931,7 +2931,6 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, COND *conds,
no_rows_const_tables
|=
table
->
map
;
}
}
stat_vector
[
i
]
=
0
;
join
->
outer_join
=
outer_join
;
...
...
@@ -7057,7 +7056,6 @@ inline void add_cond_and_fix(Item **e1, Item *e2)
}
/**
Add to join_tab->select_cond[i] "table.field IS NOT NULL" conditions
we've inferred from ref/eq_ref access performed.
...
...
sql/sql_select.h
View file @
f93b0bbe
...
...
@@ -162,7 +162,7 @@ typedef enum_nested_loop_state
RETURN
0 - OK
-1 - Record not found
Other -
E
rror
Other -
A fatal e
rror
*/
typedef
int
(
*
Read_record_func
)(
struct
st_join_table
*
tab
);
...
...
@@ -446,7 +446,6 @@ typedef struct st_join_table {
}
void
calc_used_field_length
(
bool
max_fl
);
ulong
get_used_fieldlength
()
{
if
(
!
used_fieldlength
)
calc_used_field_length
(
FALSE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment