功能指数..怎么样? [英] Functional Index.. How to?

查看:78
本文介绍了功能指数..怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

如何在db2中创建功能索引?有可能吗?
那个?我参考了在线文档。但是我找不到任何东西..


谢谢,

Thiru。

WantedToBeDBA。

Hi Friends,
How to create the functional index in db2? Is it possible to do
that? I refered in online doc. But i am unable to find anything..

Thanks,
Thiru.
WantedToBeDBA.

推荐答案

WantedToBeDBA写道:
WantedToBeDBA wrote:
嗨朋友们,
如何在db2中创建功能索引?这有可能吗?我参考了在线文档。但我无法找到任何东西..

谢谢,
Thiru。
WantedToBeDBA。
Hi Friends,
How to create the functional index in db2? Is it possible to do
that? I refered in online doc. But i am unable to find anything..

Thanks,
Thiru.
WantedToBeDBA.



DB2不支持功能索引。最接近的匹配woudl是由表达式生成的

列。它与函数索引

相同,因为你可以利用表达式利用谓词上的索引。

好​​处是你也可以从表上的功能中受益

访问权限。缺点是需要在数据页中占用内存。


示例:

CREATE TABLE T(c1 varchar(10),uc1一直生成(上层) (c1)));

CREATE INDEX i1 ON T(uc1);

INSERT INTO T(c1)VALUES(''hello''),(''world '');

SELECT c1 FROM T WHERE UPPER(c1)=''HELLO'';


干杯

Serge


DB2 does not support fucntional indexes. Teh closest match woudl be a
column genefrated by an expression. It is the same as a functional index
in the sense that you can exploit indexes on predicates with expressions.
The upside is that you can also benefit from the feature on table
access. The downside is that it takes memory in the data page.

Example:
CREATE TABLE T(c1 varchar(10), uc1 GENERATED ALWAYS AS (UPPER(c1)));
CREATE INDEX i1 ON T(uc1);
INSERT INTO T(c1) VALUES (''hello''), (''world'');
SELECT c1 FROM T WHERE UPPER(c1) = ''HELLO'';

Cheers
Serge


Serge,

你是说优化器可以选择INDEX i1进行查询

SELECT c1 FROM T在哪里上(c1)=''你好''; ?

查询是否被重写为SELECT c1 FROM T WHERE uc1 =''HELLO''?我没有

有最新发布的最新版本

Serge,
are you saying that the optimizer could choose INDEX i1 for the query
SELECT c1 FROM T WHERE UPPER(c1) = ''HELLO''; ?
Is the query rewritten as SELECT c1 FROM T WHERE uc1 = ''HELLO''? I don''t
have the latest the greatest release


ak ************ @ yahoo.com 写道:
Serge,你是说优化器可以为查询选择INDEX i1
SELECT c1 FROM T WHERE UPPER(c1)=''HELLO''; ?
查询是否重写为SELECT c1 FROM T WHERE uc1 =''HELLO''?我没有最新发布的最新版本
Serge,
are you saying that the optimizer could choose INDEX i1 for the query
SELECT c1 FROM T WHERE UPPER(c1) = ''HELLO''; ?
Is the query rewritten as SELECT c1 FROM T WHERE uc1 = ''HELLO''? I don''t
have the latest the greatest release



正确。这个特性是在DB2 V7.1中添加的,所以除非你已经过时了,否则你将拥有它。它很受欢迎。很多海报在

这个团体我们吧。


干杯

Serge


Correct. The feature was added in DB2 V7.1 so unless you are out of date
beyond hope you will have it. It''s quite popular. Lots of posters in
this group us it.

Cheers
Serge

这篇关于功能指数..怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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