InfoBright 测试报告

Download Report

Transcript InfoBright 测试报告

InfoBright 测试报告
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn
Tankertanker Design
目 录
Tankertanker Design
InfoBright 简介
InfoBright 测试报告
展示部分查询SQL
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn
Tankertanker Design
InfoBright 简介
Tankertanker Design
什么是infobright?
Infobright是一个与MySQL集成的开源数据仓库软件,可作为MySQL的一个存
储引擎来使用,SELECT查询与普通MySQL无区别。
优点:
查询性能高
--比普通Mysql 数据库引擎 (MyISAM、InnoDB) 快5-60倍.
存储数据量大 --能存储的数据量特别大.
高压缩比
-- 与普通数据库存放的数据文件相比, 可以达到55:1
不需要建立索引 --省去了大量建立索引的时间.(对于我们非常有优势)
缺点:
不能高并发.最多10个并发
Infobright 分两个版本:社区版(ICE,免费)、企业版(IEE,收费),社区版在添加数据时,
只支持load data , 而不支持.insert ,update ,delete . 企业版,则全部支持.
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn
Tankertanker Design
InfoBright 测试报告
900
Tankertanker
Design
851,81
800
700
600
500
400
300
200
155
109
109
100
5
0
12,07
3
查询新增用户数
45,89
酷站搜索量
Mysql Myisam
5,9
2,31
5,3
一天总独立用户数
InFoBright(BrightHouse)
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
一天老用户数
InfoBright 优化字段后
单位 : 耗时/S, 测试数据量: 1000W
http://i2m.cn
10,72
Tankertanker Design
InfoBright 测试报告
原始数据库引擎.(Myisam)
Tankertanker Design
建
立
索
引
00:40 执行统计脚本,耗时将近3个小
时. 大部分时间都消耗在建立索引上.
15:49 执行统计脚本,耗时25分钟. 省
去了建立索引的时间.
北京汉邦无限科技有限公司-I2M组
http://i2m.cn
http://www.hamob.com
Tankertanker Design
数据类型&部分优化
Tankertanker Design
推荐使用的数据类型:
TINYINT , INT ,BIGINT ,DECIMAL(尽量减少小数点位数), DATE , TIME
尽量避免的数据类型:
VARCHAR, FLOAT ,DOUBLE ,TINYTEXT, TEXT .
注意:
(1)
(2)
(3)
(4)
int 数据类型 最小 -2147483647, 最大2147483646.
尽量使用DECIMAL 代替Float.
尽量少用VARCHAR 尽量用CHAR 或者int 来代替.
少用select * from table 这样的语句, 减少查询字段.
参考资料:
(1)
(2)
(3)
(4)
http://blog.s135.com/infobright/
http://www.fhand.com/blog/archives/309.html
http://t.cn/zOCd858
http://t.cn/zOCeC0P
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn
Tankertanker Design
查询SQL
Tankertanker Design
查询新增用户数:
select count(*) num from (select t.mobile from tbl_access_2012_04_11 as t ,webreport.tbl_user as u where t.ch = '20005' and
t.mobile = u.mobile and u.logdate between '2012-04-11' and '2012-04-12' group by t.mobile ) as m;
酷站搜索量:
select count(*) num from tbl_access_2012_04_11 where navid in (2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2247
,2248,2249,2250,2251,2429,2253,2255,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2271,2273,2274,2275,2276,2277,22
78,2282,2515,2290,2291,2292,2293,2294,2295,2296,2298,2299,2300,2301,2302,2355,2356,2357,2358,2359,2360,2361,2362,2363,2365,2366,2367,
2368,2370,2371,2372,2373,2374,2375,2376,2378,2379,2512,2513,2514,2328,2329,2330,2431,2333,2336,2337,2338,2339,2340,2342,2343,2506,250
7,2279,2280,2281,2283,2284,2285,2286,2287,2288,2289,2435,2436,2510,2511,2317,2320,2320,2320,2321,2322,2323,2324,2325,2326,2327,2428,2
432,2437,2520,2427,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403
,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2433,2505,2516,2224,2226,2228,2229,2234,2235,2236,2237,2238,2239,2240,2241,2242,22
43,2244,2245,2246,2270,2440,2508,2414,2415,2416,2417,2420,2420,2420,2430,2349,2348,2347,2351,2350,2341,2344,2345,2346,2352,2353,2354,
2434,2438,2439,2509,2474,2476,2478,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,249
9,2500,2501,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2475,2477,2479,2451,2452,2453,2454,2455,2456,2
457,2458) and ch=20005;
查询总用户数:
select count(a.mobile) from (select mobile,count(mobile) num from weblog2.tbl_access_2012_04_11 where ch = '20005'
group by mobile) a where a.num=1;
查询老用户数:
select count(a.mobile) from (select mobile,count(mobile) num from weblog2.tbl_access_2012_04_11 where ch = '20005'
group by mobile) a,webreport.tbl_user b where a.mobile=b.mobile and b.logdate < '2012-04-11' and a.num=1;
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn
THANK YOU
北京汉邦无限科技有限公司-I2M组
http://www.hamob.com
http://i2m.cn