Commit 0cfbaccf authored by Rich Prohaska's avatar Rich Prohaska

#261 run multiple queries in part_index_scan

parent b196bddb
......@@ -64,6 +64,60 @@ insert into t3 select * from t;
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t1;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
select count(*) from t2;
count(*)
8388608
......@@ -71,10 +125,91 @@ count(*)
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
select count(*) from t3;
count(*)
8388608
1
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t1 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
select count(*) from t2 where num>7000000;
count(*)
1847274
......@@ -82,5 +217,32 @@ count(*)
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
select count(*) from t3 where num>7000000;
count(*)
1847274
1
drop table if exists t,t1,t2,t3;
# verify that index scans on parititions are not slow
# due totokudb bulk fetch not being used
# due to tokudb bulk fetch not being used
source include/have_tokudb.inc;
source include/have_partition.inc;
set default_storage_engine='tokudb';
disable_warnings;
drop table if exists t,t1,t2,t3;
enable_warnings;
let $debug = 0;
let $maxq = 10;
CREATE TABLE `t` (
`num` int(10) unsigned auto_increment NOT NULL,
......@@ -13,6 +16,7 @@ CREATE TABLE `t` (
);
# put 8M rows into t
if ($debug) { let $ts = `select now()`; echo "start $ts"; }
INSERT INTO t values (null,null);
INSERT INTO t SELECT null,null FROM t;
INSERT INTO t SELECT null,null FROM t;
......@@ -37,7 +41,9 @@ INSERT INTO t SELECT null,null FROM t;
INSERT INTO t SELECT null,null FROM t;
INSERT INTO t SELECT null,null FROM t;
INSERT INTO t SELECT null,null FROM t;
if ($debug) { let $ts = `select now()`; echo "select $ts"; }
SELECT count(*) FROM t;
if ($debug) { let $ts = `select now()`; echo "select done $ts"; }
CREATE TABLE `t1` (
`num` int(10) unsigned NOT NULL,
......@@ -68,48 +74,81 @@ PARTITION BY RANGE (num)
PARTITION p7 VALUES LESS THAN (8000000),
PARTITION px VALUES LESS THAN MAXVALUE);
if ($debug) { let $ts = `select now()`; echo "insert t1 $ts"; }
insert into t1 select * from t;
if ($debug) { let $ts = `select now()`; echo "insert t2 $ts"; }
insert into t2 select * from t;
if ($debug) { let $ts = `select now()`; echo "insert t3 $ts"; }
insert into t3 select * from t;
if ($debug) { let $ts = `select now()`; echo "select t1 $ts"; }
# verify that full index scans on partitioned tables t2 and t3 are comparable to a non-partitioned table t1
let $s = `select to_seconds(now())`;
select count(*) from t1;
let $i = 0;
while ($i < $maxq) {
select count(*) from t1;
inc $i;
}
let $t1 = `select to_seconds(now()) - $s`;
# echo $t1;
if ($debug) { let $ts = `select now()`; echo "select t2 $ts"; }
let $s = `select to_seconds(now())`;
select count(*) from t2;
let $i = 0;
while ($i < $maxq) {
select count(*) from t2;
inc $i;
}
let $t2 = `select to_seconds(now()) - $s`;
# echo $t2;
let $d = `select abs($t2 - $t1) <= $t1`;
echo $d;
if ($debug) { let $ts = `select now()`; echo "select t3 $ts"; }
let $s = `select to_seconds(now())`;
select count(*) from t3;
let $i = 0;
while ($i < $maxq) {
select count(*) from t3;
inc $i;
}
let $t3 = `select to_seconds(now()) - $s`;
# echo $t3;
let $d = `select abs($t3 - $t1) <= $t1`;
echo $d;
if ($debug) { let $ts = `select now()`; echo "select t1 $ts"; }
let $s = `select to_seconds(now())`;
select count(*) from t1 where num>7000000;
let $i = 0;
while ($i < $maxq) {
select count(*) from t1 where num>7000000;
inc $i;
}
let $t1 = `select to_seconds(now()) - $s`;
# echo $t1;
if ($debug) { let $ts = `select now()`; echo "select t2 $ts"; }
let $s = `select to_seconds(now())`;
select count(*) from t2 where num>7000000;
let $i = 0;
while ($i < $maxq) {
select count(*) from t2 where num>7000000;
inc $i;
}
let $t2 = `select to_seconds(now()) - $s`;
# echo $t2;
let $d = `select abs($t2 - $t1) <= $t1`;
echo $d;
if ($debug) { let $ts = `select now()`; echo "select t3 $ts"; }
let $s = `select to_seconds(now())`;
select count(*) from t3 where num>7000000;
let $i = 0;
while ($i < $maxq) {
select count(*) from t3 where num>7000000;
inc $i;
}
let $t3 = `select to_seconds(now()) - $s`;
# echo $t3;
let $d = `select abs($t3 - $t1) <= $t1`;
echo $d;
enable_warnings;
if ($debug) { let $ts = `select now()`; echo "done $ts"; }
drop table if exists t,t1,t2,t3;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment