Mysql物化视图应用
2012-03-13 16:34
120 查看
1、基本api
//第一步:创建物化视图
call flexviews.CREATE('demo',
'mv_company_sales_items_monthly',
'INCREMENTAL'
);
----------数据库、视图名称、刷新类型(增量刷新)
//获取视图id
select @mvid := last_insert_id();
//第二步:增加表,where条件用到
call flexviews.add_table(@mvid, 'demo', 'orders', 'o', 'USING(CustomerId)');
-----视图id,数据库名称、表名称、表别名,条件
v_mview_id - The materialized view id (see flexviews.get_id)
v_table_schema - The schema which contains the table to add
v_table_name - The name of the table to add
v_table_alias - The table alias to use in the view. All tables MUST have an alias.
v_join_clause - Every table after the first must have a NOT-NULL join clause
//第三部:
//第四部:物化视图
call flexviews.enable(@mvid);
//第一步:创建物化视图
call flexviews.CREATE('demo',
'mv_company_sales_items_monthly',
'INCREMENTAL'
);
----------数据库、视图名称、刷新类型(增量刷新)
//获取视图id
select @mvid := last_insert_id();
//第二步:增加表,where条件用到
call flexviews.add_table(@mvid, 'demo', 'orders', 'o', 'USING(CustomerId)');
-----视图id,数据库名称、表名称、表别名,条件
v_mview_id - The materialized view id (see flexviews.get_id)
v_table_schema - The schema which contains the table to add
v_table_name - The name of the table to add
v_table_alias - The table alias to use in the view. All tables MUST have an alias.
v_join_clause - Every table after the first must have a NOT-NULL join clause
//第三部:
//第四部:物化视图
call flexviews.enable(@mvid);
相关文章推荐
- ORACLE物化视图--物化视图应用之初体验~~~
- MySql视图概念与实际应用
- MySql中的视图的概念及应用
- 「mysql优化专题」视图应用竟然还可以这么优化?不得不收藏(8)
- MySql中的视图的概念及应用
- oracle物化视图的两个典型应用场景
- 傅老师课堂:Oracle高级应用之物化视图(materialized view)
- Oracle高级应用之物化视图(materialized view)
- 物化视图应用
- MySQL中实现物化视图
- 基于mysql事务、视图、存储过程、触发器的应用分析
- mysql远程表/视图-应用
- mysql视图的应用总结
- mysql触发器实现oracle物化视图
- mysql实现物化视图详解及视图与物化视图区别
- MySQL中实现物化视图
- MySQL的经典用法(三)----海量数据统计处理,模拟物化视图
- 使用mysql创建自己的物化视图
- MySQL的经典用法(三)----海量数据统计处理,模拟物化视图
- 物化视图在物流系统中的应用