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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
431c75b4
Commit
431c75b4
authored
Mar 22, 2012
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport some simple performance patches from 5.5.
parent
428fb01b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
27 deletions
+41
-27
sql/filesort.cc
sql/filesort.cc
+2
-2
sql/opt_subselect.cc
sql/opt_subselect.cc
+3
-1
sql/records.cc
sql/records.cc
+2
-1
sql/sql_select.cc
sql/sql_select.cc
+2
-1
sql/table.cc
sql/table.cc
+23
-18
strings/ctype-simple.c
strings/ctype-simple.c
+9
-4
No files found.
sql/filesort.cc
View file @
431c75b4
...
@@ -569,7 +569,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
...
@@ -569,7 +569,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
{
{
if
((
error
=
select
->
quick
->
get_next
()))
if
((
error
=
select
->
quick
->
get_next
()))
break
;
break
;
if
(
!
error
)
if
(
!
error
&&
sort_form
->
vfield
)
update_virtual_fields
(
thd
,
sort_form
);
update_virtual_fields
(
thd
,
sort_form
);
file
->
position
(
sort_form
->
record
[
0
]);
file
->
position
(
sort_form
->
record
[
0
]);
DBUG_EXECUTE_IF
(
"debug_filesort"
,
dbug_print_record
(
sort_form
,
TRUE
););
DBUG_EXECUTE_IF
(
"debug_filesort"
,
dbug_print_record
(
sort_form
,
TRUE
););
...
@@ -588,7 +588,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
...
@@ -588,7 +588,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
else
else
{
{
error
=
file
->
ha_rnd_next
(
sort_form
->
record
[
0
]);
error
=
file
->
ha_rnd_next
(
sort_form
->
record
[
0
]);
if
(
!
error
)
if
(
!
error
&&
sort_form
->
vfield
)
update_virtual_fields
(
thd
,
sort_form
);
update_virtual_fields
(
thd
,
sort_form
);
if
(
!
flag
)
if
(
!
flag
)
{
{
...
...
sql/opt_subselect.cc
View file @
431c75b4
...
@@ -4933,7 +4933,6 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
...
@@ -4933,7 +4933,6 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
bool
JOIN
::
choose_subquery_plan
(
table_map
join_tables
)
bool
JOIN
::
choose_subquery_plan
(
table_map
join_tables
)
{
{
Join_plan_state
save_qep
;
/* The original QEP of the subquery. */
enum_reopt_result
reopt_result
=
REOPT_NONE
;
enum_reopt_result
reopt_result
=
REOPT_NONE
;
Item_in_subselect
*
in_subs
;
Item_in_subselect
*
in_subs
;
...
@@ -4952,12 +4951,15 @@ bool JOIN::choose_subquery_plan(table_map join_tables)
...
@@ -4952,12 +4951,15 @@ bool JOIN::choose_subquery_plan(table_map join_tables)
}
}
else
else
return
false
;
return
false
;
/* A strategy must be chosen earlier. */
/* A strategy must be chosen earlier. */
DBUG_ASSERT
(
in_subs
->
has_strategy
());
DBUG_ASSERT
(
in_subs
->
has_strategy
());
DBUG_ASSERT
(
in_to_exists_where
||
in_to_exists_having
);
DBUG_ASSERT
(
in_to_exists_where
||
in_to_exists_having
);
DBUG_ASSERT
(
!
in_to_exists_where
||
in_to_exists_where
->
fixed
);
DBUG_ASSERT
(
!
in_to_exists_where
||
in_to_exists_where
->
fixed
);
DBUG_ASSERT
(
!
in_to_exists_having
||
in_to_exists_having
->
fixed
);
DBUG_ASSERT
(
!
in_to_exists_having
||
in_to_exists_having
->
fixed
);
Join_plan_state
save_qep
;
/* The original QEP of the subquery. */
/*
/*
Compute and compare the costs of materialization and in-exists if both
Compute and compare the costs of materialization and in-exists if both
strategies are possible and allowed by the user (checked during the prepare
strategies are possible and allowed by the user (checked during the prepare
...
...
sql/records.cc
View file @
431c75b4
...
@@ -332,6 +332,7 @@ static int rr_quick(READ_RECORD *info)
...
@@ -332,6 +332,7 @@ static int rr_quick(READ_RECORD *info)
break
;
break
;
}
}
}
}
if
(
info
->
table
->
vfield
)
update_virtual_fields
(
info
->
thd
,
info
->
table
);
update_virtual_fields
(
info
->
thd
,
info
->
table
);
return
tmp
;
return
tmp
;
}
}
...
...
sql/sql_select.cc
View file @
431c75b4
...
@@ -15524,6 +15524,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
...
@@ -15524,6 +15524,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
DBUG_RETURN
(
NESTED_LOOP_KILLED
);
/* purecov: inspected */
DBUG_RETURN
(
NESTED_LOOP_KILLED
);
/* purecov: inspected */
}
}
if
(
join_tab
->
table
->
vfield
)
update_virtual_fields
(
join
->
thd
,
join_tab
->
table
);
update_virtual_fields
(
join
->
thd
,
join_tab
->
table
);
if
(
select_cond
)
if
(
select_cond
)
...
...
sql/table.cc
View file @
431c75b4
...
@@ -2241,6 +2241,10 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
...
@@ -2241,6 +2241,10 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
/*
/*
Process virtual columns, if any.
Process virtual columns, if any.
*/
*/
if
(
!
share
->
vfields
)
outparam
->
vfield
=
NULL
;
else
{
if
(
!
(
vfield_ptr
=
(
Field
**
)
alloc_root
(
&
outparam
->
mem_root
,
if
(
!
(
vfield_ptr
=
(
Field
**
)
alloc_root
(
&
outparam
->
mem_root
,
(
uint
)
((
share
->
vfields
+
1
)
*
(
uint
)
((
share
->
vfields
+
1
)
*
sizeof
(
Field
*
)))))
sizeof
(
Field
*
)))))
...
@@ -2265,6 +2269,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
...
@@ -2265,6 +2269,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
}
}
}
}
*
vfield_ptr
=
0
;
// End marker
*
vfield_ptr
=
0
;
// End marker
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
share
->
partition_info_len
&&
outparam
->
file
)
if
(
share
->
partition_info_len
&&
outparam
->
file
)
...
...
strings/ctype-simple.c
View file @
431c75b4
...
@@ -307,6 +307,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
...
@@ -307,6 +307,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
{
{
register
const
uchar
*
sort_order
=
cs
->
sort_order
;
register
const
uchar
*
sort_order
=
cs
->
sort_order
;
const
uchar
*
end
=
key
+
len
;
const
uchar
*
end
=
key
+
len
;
ulong
n1
,
n2
;
/*
/*
Remove end space. We have to do this to be able to compare
Remove end space. We have to do this to be able to compare
...
@@ -315,12 +316,16 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
...
@@ -315,12 +316,16 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
while
(
end
>
key
&&
end
[
-
1
]
==
' '
)
while
(
end
>
key
&&
end
[
-
1
]
==
' '
)
end
--
;
end
--
;
n1
=
*
nr1
;
n2
=
*
nr2
;
for
(;
key
<
(
uchar
*
)
end
;
key
++
)
for
(;
key
<
(
uchar
*
)
end
;
key
++
)
{
{
n
r1
[
0
]
^=
(
ulong
)
((((
uint
)
nr1
[
0
]
&
63
)
+
nr2
[
0
])
*
n
1
^=
(
ulong
)
((((
uint
)
n1
&
63
)
+
n2
)
*
((
uint
)
sort_order
[(
uint
)
*
key
]))
+
(
n
r1
[
0
]
<<
8
);
((
uint
)
sort_order
[(
uint
)
*
key
]))
+
(
n
1
<<
8
);
n
r2
[
0
]
+=
3
;
n
2
+=
3
;
}
}
*
nr1
=
n1
;
*
nr2
=
n2
;
}
}
...
...
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