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
bbda4dd3
Commit
bbda4dd3
authored
Aug 22, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
3a23139a
38558705
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
sql/opt_range.cc
sql/opt_range.cc
+12
-7
No files found.
sql/opt_range.cc
View file @
bbda4dd3
...
...
@@ -442,6 +442,7 @@ typedef struct st_qsel_param {
uint
fields_bitmap_size
;
MY_BITMAP
needed_fields
;
/* bitmask of fields needed by the query */
MY_BITMAP
tmp_covered_fields
;
key_map
*
needed_reg
;
/* ptr to SQL_SELECT::needed_reg */
...
...
@@ -1765,6 +1766,7 @@ static int fill_used_fields_bitmap(PARAM *param)
param
->
fields_bitmap_size
=
(
table
->
s
->
fields
/
8
+
1
);
uchar
*
tmp
;
uint
pk
;
param
->
tmp_covered_fields
.
bitmap
=
0
;
if
(
!
(
tmp
=
(
uchar
*
)
alloc_root
(
param
->
mem_root
,
param
->
fields_bitmap_size
))
||
bitmap_init
(
&
param
->
needed_fields
,
tmp
,
param
->
fields_bitmap_size
*
8
,
FALSE
))
...
...
@@ -3202,11 +3204,14 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
/*I=set of all covering indexes */
ror_scan_mark
=
tree
->
ror_scans
;
uchar
buf
[
MAX_KEY
/
8
+
1
];
MY_BITMAP
covered_fields
;
if
(
bitmap_init
(
&
covered_fields
,
buf
,
nbits
,
FALSE
))
MY_BITMAP
*
covered_fields
=
&
param
->
tmp_covered_fields
;
if
(
!
covered_fields
->
bitmap
)
covered_fields
->
bitmap
=
(
uchar
*
)
alloc_root
(
param
->
mem_root
,
param
->
fields_bitmap_size
);
if
(
!
covered_fields
->
bitmap
||
bitmap_init
(
covered_fields
,
covered_fields
->
bitmap
,
nbits
,
FALSE
))
DBUG_RETURN
(
0
);
bitmap_clear_all
(
&
covered_fields
);
bitmap_clear_all
(
covered_fields
);
double
total_cost
=
0.0
f
;
ha_rows
records
=
0
;
...
...
@@ -3225,7 +3230,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
*/
for
(
ROR_SCAN_INFO
**
scan
=
ror_scan_mark
;
scan
!=
ror_scans_end
;
++
scan
)
{
bitmap_subtract
(
&
(
*
scan
)
->
covered_fields
,
&
covered_fields
);
bitmap_subtract
(
&
(
*
scan
)
->
covered_fields
,
covered_fields
);
(
*
scan
)
->
used_fields_covered
=
bitmap_bits_set
(
&
(
*
scan
)
->
covered_fields
);
(
*
scan
)
->
first_uncovered_field
=
...
...
@@ -3247,8 +3252,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
if
(
total_cost
>
read_time
)
DBUG_RETURN
(
NULL
);
/* F=F-covered by first(I) */
bitmap_union
(
&
covered_fields
,
&
(
*
ror_scan_mark
)
->
covered_fields
);
all_covered
=
bitmap_is_subset
(
&
param
->
needed_fields
,
&
covered_fields
);
bitmap_union
(
covered_fields
,
&
(
*
ror_scan_mark
)
->
covered_fields
);
all_covered
=
bitmap_is_subset
(
&
param
->
needed_fields
,
covered_fields
);
}
while
((
++
ror_scan_mark
<
ror_scans_end
)
&&
!
all_covered
);
if
(
!
all_covered
||
(
ror_scan_mark
-
tree
->
ror_scans
)
==
1
)
...
...
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