Oracle 的视图与索引
有表A(字段A1,A2)和表B(字段B1,B2).
字段A2,B2上都有索引.
A,B 表联查
sql1 这个sql 非常快 2秒的样子
select * from A,B where A.A1=B.B1(+) and A2='值1'
sql2 这个sql 慢到让人无法忍受
select * from A,B where A.A1=B.B1(+) and B2='值1'
外联以后 表B上的索引不起作用了.
如果换成内联 速度很快.
select * from A,B where A.A1=B.B1 and B2='值1'
1.物化视图
普通视图不可以建索引。物化视图可以建索引。
CREATE MATERIALIZED VIEW m_tb REFRESH WITH ROWID as select * from tb;
create index idx_tb on m_tb(col1);
2.用hint语句强制指定优化器类型
select /*+index(A,idx_a1) index(B,idx_b1)*/* from A,B where A.A1=B.B1(+) and B1='值1'
2010-02-16 16:04:51 BY TZC
相关文档:
也许对SQL Server来说,取前N位的数据是很简单的事情,一条TOP语句就搞定了.
在Oracle中我们往往会感觉到头疼,平日里也常会用到,主要是使用partition by.
语法如下:
select emp_card_no,work_date,read_card_date,count(rownum) as cnt
from hra_read_car ......
Oracle JDeveloper 10g Release Download
Oracle JDeveloper 10g (version 9.0.5.1, build 1605) for Windows NT/2000/X, Linux, Solaris, and HP-UX.
http://download.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-east.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-west ......
--日期转换毫秒
SELECT TO_NUMBER(TO_DATE('2005-03-29 12:30:45', 'YYYY-MM-DD HH24:MI:SS') -
TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 * 60 * 1000
from DUAL;
--毫秒转换日期
SELECT TO_CHAR(1112070645000 / (1000 * 60 * 60 * 24) +
TO_ ......
RedHat Linux安装Oracle10g(图文详解 教程)
http://winie.javaeye.com/blog/405120
关键字: redhat linux安装oracle10g(图文详解 教程)
另,本人有Word电子文档格式,如需要,请联系本人:asima127@gmail.com
1
安装RedHat Enterprise Linux 3 ......
OleDbConnectioncon=newOleDbConnection(cnnstr);
try
{
con.Open();
}
catch
{}
OleDbCommandcmd=newOleDbCommand(strSQL,con);
System.Data.OleDb.OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())
{
stringdd=dr["gggg"].ToString();
byte[]ooo=(byte[])dr["hhhh"];
stringstr;
str=Sys ......