
with aa as(

成都創(chuàng)新互聯(lián)是創(chuàng)新、創(chuàng)意、研發(fā)型一體的綜合型網(wǎng)站建設(shè)公司,自成立以來(lái)公司不斷探索創(chuàng)新,始終堅(jiān)持為客戶(hù)提供滿(mǎn)意周到的服務(wù),在本地打下了良好的口碑,在過(guò)去的十年時(shí)間我們累計(jì)服務(wù)了上千家以及全國(guó)政企客戶(hù),如辦公窗簾等企業(yè)單位,完善的項(xiàng)目管理流程,嚴(yán)格把控項(xiàng)目進(jìn)度與質(zhì)量監(jiān)控加上過(guò)硬的技術(shù)實(shí)力獲得客戶(hù)的一致夸獎(jiǎng)。
select * from view1
union all
select * from view2 ...)
select callid,sum(callerno)
from aa a
where a.begintime >.. and endtime <..
group by callid order by callerno
1、可以縮小到5張表,因?yàn)楹芏喽际菑囊粡埍砝锶〕鰜?lái)的數(shù)據(jù);
2、不能子查詢(xún)因?yàn)槭且@示數(shù)據(jù)子查詢(xún)只是查詢(xún)條件;
3不能建立索引,因?yàn)檫@樣會(huì)影響表的增刪改,它里面都是導(dǎo)入進(jìn)去的一次增加上千條都有可能;
4、定期結(jié)轉(zhuǎn)是什么意思,表示沒(méi)看懂。時(shí)間發(fā)的太長(zhǎng)的話(huà)就算了;
5、定期結(jié)轉(zhuǎn)的意思就是,將你要建立視圖的幾種表數(shù)據(jù)“轉(zhuǎn)移”到一張新表里面去,不用視圖查詢(xún)。數(shù)據(jù)庫(kù)全文檢索是RDBMS自帶的擴(kuò)展功能,可以實(shí)現(xiàn)高速查詢(xún)。全文檢索建議搜索下關(guān)鍵字,什么lucene之類(lèi)的就出來(lái)了。
這幾天做性能優(yōu)化 網(wǎng)上找了些資料
有時(shí)候需要導(dǎo)出某用戶(hù)下的所有table view sequence trigger等信息 下面的SQL可以將這些信息select出來(lái)
select * from user_tables;
select * from user_views;
select * from user_sequences;
select * from user_triggers;
想查找表的數(shù)據(jù)條數(shù)
試試這個(gè)
select t table_name t num_rows from user_tables t
如果沒(méi)有值 那就創(chuàng)建個(gè)函數(shù)
代碼
create or replace function count_rows(table_name in varchar
owner in varchar default null)
return number
authid current_user
IS
num_rows number;
stmt varchar ( );
begin
if owner is null then
stmt := select count(*) from ||table_name|| ;
else
stmt := select count(*) from ||owner|| ||table_name|| ;
end if;
execute immediate stmt into num_rows;
return num_rows;
end
再執(zhí)行查詢(xún)
lishixinzhi/Article/program/Oracle/201311/18185