刪除表的資料來提高SQL效率

今天上午查看em工具,在9點半的時候applications又升到了60去,雖然很快釋放,沒有引起資料庫慢,但是這裡還是重視一下。用上午8點到10的快照做成一個awr報告,通過查看 SQL Statistice-SQL ordered by elapsed time,找出排名第一的SQL,Sql如下:----------------------------------------------------------------- Select Message_Id,       Reciver_

子查詢解嵌套導致SQL變慢

原SQL如下,跑4分鐘左右Select Guest_Id, t_To_Order_Tickets.Order_Id, t_To_Order_Info.Contact_Mobile, Guest_Name, Guest_Idno, Departure_Time, Trip_Num, Arrival_Time From t_To_Order_Tickets Left Join t_To_Order_Info

反串連的實驗

關於反串連的實驗:not exists 和not in等都屬於反串連------------------------------------------------------------------------------實驗1:SQL> Explain plan for Select * from emp 2 where not exists 3 (Select * from dept where dept.deptno=emp.deptno) 4 ;

查看預存程序的執行計畫

預存程序沒有執行計畫,查看的是預存程序中SQL語句的執行計畫,這裡用10046來看---------------------------------------------------- 建立預存程序Create Or Replace Procedure Lee_Xc(Eno Number) IsBegin Select Empno, Ename, Dname From Emp, Dept Where Emp.Deptno = Dept.Deptno And

表量子查詢最佳化SQL

開發發來條SQL,7分32秒出236行資料 Select Ot.Guest_Id, Ot.Order_Id, Ot.Guest_Name, Oct.Guest_Name, Ot.Ticket_Price, Oct.Ticket_Price From t_To_Order_Tickets Ot Left Join (Select Oct.*, (Select Order_Id

查詢訪問一個表的兩個索引

原文地址:http://yangtingkun.itpub.net/post/468/499769經常看到有人提出這樣的疑問,我在同一張表上建立了多個索引,為什麼Oracle每次都選擇一個,而不能同時利用多個索引呢。一般來說,常見的訪問同一張表的兩個以上索引,存在三種情況,AND-EQUAL、INDEX HASH JOIN和BITMAP INDEX

AND_EQUAL和複合式索引最佳化一條SQL

在系統負載高的時候抓出一條SQL,1分23秒左右出152行select a.Case_ID, a.Case_Type_ID, a.Case_Subject, a.Case_Content, a.Create_Employee_ID, a.Case_Create_Time, a.Customer_ID, a.Dept_ID, a.Lock_Employee_ID, a.Order_ID,

增加表串連來最佳化SQL

Select Ci.Customer_Id, Ci.Customer_Name, Mc.Card_Id, t.Card_Type_Name, f_Getcustomercontactmeans(Ci.Customer_Id) As Cust_Contactmeans From v_Customer_Info Ci Inner Join t_Mc_Card_Used Mc On Mc.Card_Used_Id = (Select

幫ITPUB網友調SQL

http://www.itpub.net/viewthread.php?tid=1462612&extra=page%3D1&page=1 SQL> explain plan for select ((v.yvalue * 300) / (u.xvalue * 50)), u.xtime 2 from (select x.index_value xvalue, substr(x.update_time, 1, 14) xtime 3

使用WITH AS 最佳化SQL

馬上就要單身節了,正在想今年我去禍害誰家的姑娘,突然QQ好友發來資訊,說能否幫忙最佳化一個SQL,SQL調優做得實在太多了,都已經麻木了,反正最佳化一個SQL也就幾秒鐘到幾分鐘的事情。哥們說下面的SQL要跑5個多小時SELECT B.AREA_ID, A.PARTY_ID, B.AREA_NAME, C.NAME CHANNEL_NAME,

VBox Guset Additions 功能增強 說明

 虛擬機器使用的是VBox,之前都是直接SSH 過去,在ssh裡粘貼複製,如果不SSH,在虛擬機器視窗切換和剪下板之間的共用都很麻煩。  昨天google 一下,發現VBox 有個安裝增強功能,Guset

一個超超超爛SQL的最佳化

最近遇到一個超超超爛的SQL,由於SQL涉及某某稅務局的資料,表名字是經過處理的。原始SQL如下:select * from ( select t.zxid,t.gh,t.xm,t.bm,t.fzjgdm, (select count(a.session_id) from test_v a where to_char(t.zxid) = a.ZCRYZH) slzl, (select count(a.session_id) from test_v a where

VBox fdisk 不顯示 添加的硬碟 解決方案

  用fdisk 命令查看不到我們添加的磁碟: [root@rac1 ~]# fdisk -l Disk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280bytesSector size (logical/physical): 512 bytes /512 bytesI/O size

利用分區最佳化SQL

一個哥們QQ問我,這個SQL怎麼最佳化,它要跑160秒 SQL> explain plan for select a.so_region_code so_region_code, 2 a.so_county_code so_county_code, 3 a.so_org_id so_org_id, 4 d.org_type_id org_type_id, 5

如何製作PDF,以及給PDF添加書籤

    現在萌發了這樣一個念頭,想把自己學過的Oracle知識,自己的常用指令碼,以及一些調優心得寫下來,這樣方便以後查看,以及copy常用指令碼。不過發現Word不方便查看,於是想將其轉換為PDF,之前沒有做過PDF,所以還不知道怎麼做。    於是Google了一下,發現PDF製作還是挺簡單的,網路上的方法很多,不過最常用的應該是下載WPS office

複合式索引最佳化一條SQL

原始SQL,出來的資料為零行,這不是重點,統計資訊沒有到期,這裡不考慮統計資訊的問題 分別看下設計到表的行數 select count(*) from t_ho_room_price      --3254605 select count(*) from t_ho_order_info      --2034996 select count(*) from t_ho_order_statistics --2034996 Select count(*) from

/dev/sdxx is apparently in use by the system; will not make a filesystem here! 解決方案

 在儲存上共用了一個500G的空間,映射到Linux系統提供上,環境由2個節點群組成。 一. 測試一: 直接mount用fdisk 格式化之後如下:[root@rac1 u01]# fdisk -l……Disk /dev/sdk: 536.8 GB, 536870912000 bytes255 heads, 63 sectors/track, 65270cylindersUnits = cylinders of 16065 * 512 = 8225280bytes   Device Boot  

強制走索引失效的情況

select count(0) from creditguarantee cg where 1=1 and cg.createddate>=to_date('2012-02-23','yyyy-MM-dd') and cg.createddate<=to_date('2012-02-26','yyyy-MM-dd') and 2= (case when

Secure CRT 自動記錄日誌 配置 小記

      作為一個營運DBA,在處理故障或者操作的時候,都應該養成一個記錄日誌的資訊。當然,一般我們也是通過SecureCRT來串連系統,因此都是用這個工具來記錄日誌。        之前我都是每次操作之前,點擊記錄日誌的功能。麻煩是麻煩一點,到也習慣了這種做法,當然,有時候也會忘記記錄log。     昨天研究了一下,SecureCRT 也是可以自動記錄日誌的。 當然,這個功能在N年前就有了,只是我一直沒有去研究它。     搜了一下SecureCRT

index range scan,index fast full scan,index skip scan發生的條件

index range scan(索引範圍掃描):1.對於unique index來說,如果where 條件後面出現了<,> ,between ...and...的時候,那麼就可能執行index range scan,如果where條件後面是=,那麼就會執行index unique scan。2.對於none unique index來說 如果where 條件後面出現了=,>,<,betweed...and...的時候,就有可能執行index range

總頁數: 61357 1 .... 19260 19261 19262 19263 19264 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.