是否可以在SQL中用HS连接替换NL连接 [英] Is it possible to replace NL join with HS join in sql

查看:120
本文介绍了是否可以在SQL中用HS连接替换NL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的查询,其中包含两个主表和15个子表。

Hi am having a very big query comprises of two main table and 15 sub tables.

ie, Main table say table_a join with some other 10 tables.
and another main table sat table_b join with some other 5 tables.

Table_a contains - 314988 rows and 
Table_b contains - 710989 rows.

当我们加入时,我会发现很多NL Joins和HS Joins。

when we join i could find many NL Joins and HS joins.

有趣的事实是,所有 HSjoin的成本都非常低,而NL join的成本却非常高。

intresting fact that all HSjoin cost very less and NL join cost very very high.

因此可以将联接从NL转换为HS联接。

So is it possible to convert the joins from NL to HS Join.

注意:它的所有索引都已建立。没有TBSCAN,所有都是IXSCAN。

Note : its all indexed.. there is no TBSCAN everything is IXSCAN.

推荐答案

您可以创建优化配置文件,在该配置文件中,您将向优化器指示应使用哪种方法来访问给定查询的数据。

You can create an optimization profile, where you will indicate to the optimizer which methods it should use to access the data for the given query.

从DeveloperWorks看一下本教程: http://www.ibm.com/developerworks/data/library/techarticle/dm-1202storedprocedure/index.html

Take a look at this tutorial from DeveloperWorks: http://www.ibm.com/developerworks/data/library/techarticle/dm-1202storedprocedure/index.html

这篇关于是否可以在SQL中用HS连接替换NL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆