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
cb6d0e3c
Commit
cb6d0e3c
authored
Mar 11, 2010
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
1e2eb3cd
2d5c6b5b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/r/partition_range.result
mysql-test/r/partition_range.result
+14
-0
mysql-test/t/partition_range.test
mysql-test/t/partition_range.test
+18
-0
sql/ha_partition.cc
sql/ha_partition.cc
+1
-0
No files found.
mysql-test/r/partition_range.result
View file @
cb6d0e3c
drop table if exists t1, t2;
#
# Bug#48229: group by performance issue of partitioned table
#
CREATE TABLE t1 (
a INT,
b INT,
KEY a (a,b)
)
PARTITION BY HASH (a) PARTITIONS 1;
INSERT INTO t1 VALUES (0, 580092), (3, 894076), (4, 805483), (4, 913540), (6, 611137), (8, 171602), (9, 599495), (9, 746305), (10, 272829), (10, 847519), (12, 258869), (12, 929028), (13, 288970), (15, 20971), (15, 105839), (16, 788272), (17, 76914), (18, 827274), (19, 802258), (20, 123677), (20, 587729), (22, 701449), (25, 31565), (25, 230782), (25, 442887), (25, 733139), (25, 851020);
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
DROP TABLE t1;
create table t1 (a int)
partition by range (a)
( partition p0 values less than (maxvalue));
...
...
mysql-test/t/partition_range.test
View file @
cb6d0e3c
...
...
@@ -9,6 +9,24 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
--
echo
#
--
echo
# Bug#48229: group by performance issue of partitioned table
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
KEY
a
(
a
,
b
)
)
PARTITION
BY
HASH
(
a
)
PARTITIONS
1
;
# insert some rows (i.e. so that rows/blocks > 1)
INSERT
INTO
t1
VALUES
(
0
,
580092
),
(
3
,
894076
),
(
4
,
805483
),
(
4
,
913540
),
(
6
,
611137
),
(
8
,
171602
),
(
9
,
599495
),
(
9
,
746305
),
(
10
,
272829
),
(
10
,
847519
),
(
12
,
258869
),
(
12
,
929028
),
(
13
,
288970
),
(
15
,
20971
),
(
15
,
105839
),
(
16
,
788272
),
(
17
,
76914
),
(
18
,
827274
),
(
19
,
802258
),
(
20
,
123677
),
(
20
,
587729
),
(
22
,
701449
),
(
25
,
31565
),
(
25
,
230782
),
(
25
,
442887
),
(
25
,
733139
),
(
25
,
851020
);
# Before the fix the 'Extra' column showed 'Using index for group-by'
EXPLAIN
SELECT
a
,
MAX
(
b
)
FROM
t1
WHERE
a
IN
(
10
,
100
,
3
)
GROUP
BY
a
;
DROP
TABLE
t1
;
#
# BUG 33429: Succeeds in adding partition when maxvalue on last partition
#
...
...
sql/ha_partition.cc
View file @
cb6d0e3c
...
...
@@ -5090,6 +5090,7 @@ int ha_partition::info(uint flag)
file
=
m_file
[
handler_instance
];
file
->
info
(
HA_STATUS_CONST
);
stats
.
block_size
=
file
->
stats
.
block_size
;
stats
.
create_time
=
file
->
stats
.
create_time
;
ref_length
=
m_ref_length
;
}
...
...
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