ITPub博客

首页 > 数据库 > Oracle > 在SQL语句中用PARALLEL指定并行查询

在SQL语句中用PARALLEL指定并行查询

原创 Oracle 作者:ITtomilk 时间:2015-12-16 15:26:33 0 删除 编辑
在日常查询中为提供SQL的查询速度,常用到parallel 关键字执行并行查询。

1.第一种对下面的SQL对xt.test1 用并行怎么写 ?
2.第二种对下面的SQL对2张表都用并行怎么写?
select count(*) from xt.test1 a,xt.test2 b where a.xh = b.xh 

1. 
select /*+ PARALLEL(a, 5) */count(*) from xt.test1 a,xt.test2 b where a.xh = b.xh 

2. 
select /*+ PARALLEL(a, 5)  PARALLEL(b, 5) */count(*) from xt.test1 a,xt.test2 b where a.xh = b.xh

其中5为并行度,可自行调整!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30260000/viewspace-1873321/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-05-25

  • 博文量
    42
  • 访问量
    90724