c*****t 发帖数: 1879 | 1 这两个 database 支不支持 variable length byte array ?如果支持的话,
最大能有多大?
这里不是指 BLOB 。
thx |
B*****g 发帖数: 34098 | 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
|
c*****t 发帖数: 1879 | 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
|
B*****g 发帖数: 34098 | 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 有些地方有限制,不太容易继续弄。
|
c*****t 发帖数: 1879 | 5 我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须
index 。
【在 B*****g 的大作中提到】 : I did not see any problem in oracle to use CLOB as long as not store in : table.
|
B*****g 发帖数: 34098 | 6 那你就用long好了(original words from an oracle guy:"if you still use long,
shame on you")。
另外好奇一下,index干啥用?
【在 c*****t 的大作中提到】 : 我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须 : index 。
|
c*****t 发帖数: 1879 | 7 Oracle 应该支持 index on expression 吧。
比如 index on MyEval (col),然后每次碰到
where MyEval (col) > 1000
就用到该 index 。
这样的话,就可以做很多 fansy 的东西。
【在 c*****t 的大作中提到】 : 我这个必须存在 table 里。一般来说可能有 10k 甚至更多一些。还必须 : index 。
|
B*****g 发帖数: 34098 | 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 的东西。
|