Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

OracleË÷Òý±Ê¼Ç

 Ò».B-TreeË÷Òý(b-tree index)
1. Ñ¡ÏîÔñË÷Òý×ֶεÄÔ­Ôò: 
ÔÚWHERE×Ó¾äÖÐ×îƵ·±Ê¹ÓõÄ×ֶΠ
Áª½ÓÓï¾äÖеÄÁª½Ó×ֶΠ
Ñ¡Ôñ¸ßÑ¡ÔñÐÔµÄ×Ö¶Î(Èç¹ûºÜÉÙµÄ×Ö¶ÎÓµÓÐÏàֵͬ,¼´Óкܶà¶ÀÌØÖµ,ÔòÑ¡ÔñÐԺܺÃ) 
ORACLEÔÚUNIQUEºÍÖ÷¼ü×Ö¶ÎÉÏ×Ô¶¯½¨Á¢Ë÷Òý 
ÔÚÑ¡ÔñÐԺܲîµÄ×Ö¶ÎÉϽ¨Ë÷ÒýÖ»ÓÐÔÚÕâ¸ö×ֶεÄÖµ·Ö²¼·Ç³£ÇãбµÄÇé¿öÏÂϲÅÓÐÒæ(ÔÚÕâÖÖÇé¿öÏÂ,ijһ,Á½¸ö×Ö¶ÎÖµ±ÈÆäËü×ÖÖµÉÙ³öÏֺܶà) 
²»ÒªÔÚºÜÉÙ¶ÀÌØÖµµÄ×Ö¶ÎÉϽ¨B-TREEË÷Òý,ÔÚÕâÖÖÇé¿öÏÂ,Äã¿ÉÒÔ¿¼ÂÇÔÚÕâЩ×Ö¶ÎÉϽ¨Î»Í¼Ë÷Òý.ÔÚÁª»úÊÂÎñ´¦Àí»·¾³ÏÂ,ËùÓɲ¢·¢ÐԷdz£¸ß,Ë÷Òý¾­³£±»ÐÞ¸Ä,ËùÒÔ²»Ó¦¸Ã½¨Î»Í¼Ë÷Òý 
²»ÒªÔÚ¾­³£±»Ð޸ĵÄ×Ö¶ÎÉϽ¨Ë÷Òý.µ±ÓÐUPDATE,DELETE,INSETT²Ù×÷ʱ,ORACLE³ýÁËÒª¸üбíµÄÊý¾ÝÍâ,ͬʱҲҪ¸üÐÂË÷Òý,¶øÇÒ¾ÍÏó¸üÐÂÊý¾ÝÒ»Ñù,»ò²úÉú»¹Ô­ºÍÖØ×öÌõÄ¿ 
²»ÒªÔÚÓÐÓõ½º¯ÊýµÄ×Ö¶ÎÉϽ¨Ë÷Òý,ORACLEÔÚÕâÖÖÇé¿ö,ÓÅ»¯Æ÷²»»áÓõ½Ë÷Òý,³ý·ÇÄ㽨Á¢º¯ÊýË÷Òý 
¿ÉÒÔ¿¼ÂÇÔÚÍâ¼ü×Ö¶ÎÉϽ¨Ë÷Òý,ÕâЩË÷ÒýÔÊÐíµ±ÔÚÖ÷±íÉÏUPDATE,DELETE²Ù×÷ʱ,²»ÐèÒª¹²Ïí×Ó±íµÄËø,Õâ·Ç³£ÊÊÓÃÓÚÔÚ¸¸±íºÍ×Ó±íÉÏÓкܶಢ·¢µÄINSERT,UPDATEºÍDELETE²Ù×÷µÄÇé¿ö 
µ±½¨Á¢Ë÷Òýºó,Çë±È½ÏÒ»ÏÂË÷ÒýºóËù»ñµÃµÄ²éѯÐÔÄܵÄÌá¸ßºÍUPDATE,DELETE,INSERT²Ù×÷ÐÔÄÜÉϵÄËðʧ,±È½ÏµÃʧºó,ÔÙ×îºó¾ö¶¨ÊÇ·ñÐ轨Á¢Õâ¸öË÷Òý 
2. Ñ¡Ôñ½¨Á¢¸´ºÏË÷Òý(composite index) 
¸´ºÏË÷ÒýµÄÓŵã: 
¸ÄÉÆÑ¡ÔñÐÔ:¸´ºÏË÷Òý±Èµ¥¸ö×ֶεÄË÷Òý¸ü¾ßÑ¡ÔñÐÔ 
¼õÉÙI/O:Èç¹ûÒª²éѯµÄ×ֶθպÃÈ«²¿°üº¬ÔÚ¸´ºÏË÷ÒýµÄ×Ö¶ÎÀï,ÔòORACLEÖ»Ðë·ÃÎÊË÷Òý,ÎÞÐë·ÃÎʱí 
ʲôÇé¿öÏÂÓÅ»¯Æ÷»áÓõ½¸´ºÏË÷ÒýÄØ? 
(a)µ±SQLÓï¾äµÄWHERE×Ó¾äÖÐÓÐÓõ½¸´ºÏË÷ÒýµÄÁìµ¼×Ö¶Îʱ,ORACLEÓÅ»¯Æ÷»á¿¼ÂÇÓõ½¸´ºÏË÷ÒýÀ´·ÃÎÊ. 
(b)µ±Ä³¼¸¸ö×Ö¶ÎÔÚSQLÓï¾äµÄWHERE×Ó¾äÖо­³£Í¨¹ýAND²Ù×÷·ûÁªºÏÔÚһЩʹÓÃ×÷Ϊ¹ýÂËν´Ê,²¢ÇÒÕ⼸¸ö×ֶκÏÔÚÒ»ÆðʱѡÔñÐԱȸ÷×Ôµ¥¸ö×ֶεÄÑ¡ÔñÐÔÒª¸üºÃʱ,¿ÉÄÜ¿¼ÂÇÓÃÕ⼸¸ö×Ö¶ÎÀ´½¨Á¢¸´ºÏË÷Òý. 
(c)µ±Óм¸¸ö²éѯÓï¾ä¶¼ÊDzéѯͬÑùµÄ¼¸¸ö×Ö¶Îֵʱ,Ôò¿ÉÒÔ¿¼ÂÇÔÚÕ⼸¸ö×Ö¶ÎÉϽ¨Á¢¸´ºÏË÷Òý. 
¸´ºÏË÷Òý×Ö¶ÎÅÅÐòµÄÔ­Ôò: 
È·±£ÔÚWHERE×Ó¾äÖÐʹÓõ½µÄ×Ö¶ÎÊǸ´ºÏË÷ÒýµÄÁìµ¼×ֶΠ
Èç¹ûij¸ö×Ö¶ÎÔÚWHERE×Ó¾äÖÐ×îƵ·±Ê¹ÓÃ,ÔòÔÚ½¨Á¢¸´ºÏË÷Òýʱ,¿¼ÂÇ°ÑÕâ¸ö×Ö¶ÎÅÅÔÚµÚһλ(ÔÚCREATE INDEXÓï¾äÖÐ) 
Èç¹ûËùÓеÄ×Ö¶ÎÔÚWHERE×Ó¾äÖÐʹÓÃƵÂÊÏàͬ,Ôò½«×î¾ßÑ¡ÔñÐÔµÄ×Ö¶ÎÅÅÔÚ×îÇ°Ãæ,½«


Ïà¹ØÎĵµ£º

Oracle ´æ´¢¹ý³Ì

 
create or replace procedure p   //ÓоÍÌæ»»£¬Ã»Óоʹ´½¨
is
     cursor c is
         select * from emp for update;
begin
  for v_emp in c loop
      if (v_emp.deptno =10) then
 &nb ......

Virtual Columns in Oracle Database 11g

When queried, virtual columns appear to be normal table columns, but
their values are derived rather than being stored on disc. The syntax
for defining a virtual column is listed below.
column_name [datatype] [GENERATED ALWAYS] AS (expression) [VIRTUAL]
If the datatype is omitted, it is determin ......

oracleÖÐʵÏֵݹé²éѯµÄSQL£¨connect by prior£©

    Ç°¶Îʱ¼ä×öÁËÒ»¸öÐéÄâ×éÖ¯µÄ´´½¨¡£Õâ¸öÐéÄâ×éÖ¯µÄ´´½¨ÊÇ´ÓÏÖÓеÄ×éÖ¯ÖжÁÈ¡Êý¾ÝÈ»ºó½øÐзÖÎö±£´æµ½ÐéÄâ×éÖ¯±íÖС£±£´æÖ®ºóдÈÕÖ¾·½±ãͬ²½µ½ÆäËüϵͳÖС£¹«Ë¾Ê¹ÓõÄÖ÷Òª¼¼ÊõÊÇSSH¡£ÓÉÓÚÊÇÐÂÈËûÓÐʲô¾­Ñ飬¼Ó֮ʱ¼ä±È½Ï½ôÆÈ£¬×îºóʹÓÃÒ»°ãµÄÂß¼­Ë¼Ïëͨ¹ýµÝ¹éÔÚhibernateÏÂ˳Àû´´½¨ÁË¡£¿ÉÊÇ´ÓÏÖÓеÄ×éÖ¯Ö ......

OracleÖÐTO_DATE¸ñʽ

 TO_DATE¸ñʽ(ÒÔʱ¼ä:2007-11-02   13:45:25ΪÀý)
  
        Year:     
        yy two digits Á½Î»Äê              ......

OracleÖеÄcovering index

 CSDNÀïµÄÒ»¸öÅóÓÑÎʵ½ÁËÕâ¸öË÷Òý¸²¸ÇµÄ¸ÅÄî¡£ Õâ¸ö¸ÅÄîºÜСµÄ֪ʶµã£¬ÔÚÎÒµÄÂÛ̳ÀïÓнâÊÍ“”£¬²»¹ý×÷ΪOracle°æÖ÷£¬²»ÄÜÔÚ»ØÌûÀï¼ÓÉÏÍøÍâµÄµØÖ·Á´½Ó£¬ËùÒÔÕâÀïÔÚCSDNÀïÌûÉÏÒ»·Ý
±ÈÈçÓи´ºÏË÷ÒýΪ3¸ö×ֶΣºf1 + f2 + f3,ÇëÎÊ: 
1: select f1, f2, f3, f4 from table where f1 = 'XX' and f2 = 'XX'. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ