avatar
Oracle / DB2 问题# Database - 数据库
c*t
1
这两个 database 支不支持 variable length byte array ?如果支持的话,
最大能有多大?
这里不是指 BLOB 。
thx
avatar
B*g
2
oracle
CREATE TYPE type_beijing_1 AS VARRAY (100) OF CLOB
or
CREATE TYPE type_beijing_2 AS VARRAY (100) OF VARCHAR2(32767)
32767 can not be used for sql, you have to change to 4000
why do you need array? I would rather use
CREATE TYPE type_beijing_3 AS TABLE OF CLOB

【在 c*****t 的大作中提到】
: 这两个 database 支不支持 variable length byte array ?如果支持的话,
: 最大能有多大?
: 这里不是指 BLOB 。
: thx

avatar
c*t
3
因为我需要用到 custom data type 。而这 custom data type 的长度是
不确定的。可能可以很长。
PostgreSQL 可以让 byte[] 的长度最长到 2GB,没特别的 performance
penalty (也就是 varchar(40) 其实和 byte[] 的速度一样)。
我主要是想看看是否能够移植我在 pgsql 上的 code 到 oracle / db2
上。主要是现在 pgsql 有些地方有限制,不太容易继续弄。

【在 B*****g 的大作中提到】
: oracle
: CREATE TYPE type_beijing_1 AS VARRAY (100) OF CLOB
: or
: CREATE TYPE type_beijing_2 AS VARRAY (100) OF VARCHAR2(32767)
: 32767 can not be used for sql, you have to change to 4000
: why do you need array? I would rather use
: CREATE TYPE type_beijing_3 AS TABLE OF CLOB

avatar
B*g
4
I did not see any problem in oracle to use CLOB as long as not store in
table.

【在 c*****t 的大作中提到】
: 因为我需要用到 custom data type 。而这 custom data type 的长度是
: 不确定的。可能可以很长。
: PostgreSQL 可以让 byte[] 的长度最长到 2GB,没特别的 performance
: penalty (也就是 varchar(40) 其实和 byte[] 的速度一样)。
: 我主要是想看看是否能够移植我在 pgsql 上的 code 到 oracle / db2
: 上。主要是现在 pgsql 有些地方有限制,不太容易继续弄。

avatar
c*t
5
我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须
index 。

【在 B*****g 的大作中提到】
: I did not see any problem in oracle to use CLOB as long as not store in
: table.

avatar
B*g
6
那你就用long好了(original words from an oracle guy:"if you still use long,
shame on you")。
另外好奇一下,index干啥用?

【在 c*****t 的大作中提到】
: 我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须
: index 。

avatar
c*t
7
Oracle 应该支持 index on expression 吧。
比如 index on MyEval (col),然后每次碰到
where MyEval (col) > 1000
就用到该 index 。
这样的话,就可以做很多 fansy 的东西。

【在 c*****t 的大作中提到】
: 我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须
: index 。

avatar
B*g
8
yes, function based index.
but this one is more interesting. sql server 2008 has similar thing.
http://download-west.oracle.com/docs/cd/B19306_01/text.102/b14217/quicktour.htm

【在 c*****t 的大作中提到】
: Oracle 应该支持 index on expression 吧。
: 比如 index on MyEval (col),然后每次碰到
: where MyEval (col) > 1000
: 就用到该 index 。
: 这样的话,就可以做很多 fansy 的东西。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。