02.Oracle/DataBase2013. 2. 6. 11:41
반응형

출처 : http://dbclose.tistory.com/75

 

오라클은 MySql 에서 지원하는 order by LIMIT 를 지원하지 않아 페이징 처리 속도가 느리다.

알려진 오라클 페이징 기법을 테스트 하여 속도를 비교해 보자

SAMPLE 테이블에 100만건의 데이트를 입력 후 10개씩 보여지는 마지막 페이지를 조회
정렬 조건은 PRIMARY KEY DESC 정렬

1. 페이지 수를 계산하여 셀렉트

SELECT B.* FROM (
SELECT
CEIL(ROWNUM/10) PAGE
--, COUNT(*) OVER() AS TOTAL_COUNT
, A.* FROM (
SELECT * FROM OP_SAMPLE
ORDER BY ID DESC
) A
) B
WHERE PAGE = 100000;


100만 건인 경우 수행시간 : 1.327초, TOTAL_COUNT 까지 조회시 : 3.848초
10만 건인 경우 수행시간 : 0.135초 TOTAL_COUNT 까지 조회시 : 0.255초



2. ROW_NUMBER()를 이용한 페이징

SELECT * FROM (
SELECT A.*, ROW_NUMBER() OVER(ORDER BY ID DESC) AS NUM
FROM OP_SAMPLE A
)
WHERE NUM BETWEEN 999991 AND 1000000;

100만 건인 경우 수행시간 : 1.136초
10만 건인 경우 수행시간 : 0.253초



3. ROWNUM을 이용한 페이징

SELECT * FROM (
SELECT ROWNUM AS RNUM, Z.* FROM (
SELECT * FROM OP_SAMPLE ORDER BY ID DESC
) Z WHERE ROWNUM <= 1000000
) WHERE RNUM >= 999991;

100만 건인 경우 수행시간 : 0.826초
10만 건인 경우 수행시간 : 0.087초



4. ROWNUM + 인덱스를 이용한 페이징

SELECT * FROM (
SELECT /*+ INDEX_DESC(Z OP_SAMPLE_PK) */ ROWNUM AS RNUM, Z.* FROM (
SELECT * FROM OP_SAMPLE
) Z WHERE ROWNUM <= 1000000
) WHERE RNUM >= 999991;

100만 건인 경우 수행시간 : 0.687초
10만 건인 경우 수행시간 : 0.079초



참고로 MySql 쿼리 조회시 (mysql 5, innoDB)

SELECT * FROM OP_SAMPLE
ORDER BY ID DESC LIMIT 999991, 10;

100만 건인 경우 수행시간 : 0.033초
Posted by 1010
02.Oracle/DataBase2013. 2. 5. 23:29
반응형

TOAD for Oracle Freeware 10.6 Free Download

Secure TOAD for Oracle Freeware Download Options

Download Now! TOAD for Oracle Freeware 10.6

More download options:

 

TOAD for Oracle Freeware 9.7

Thank you for downloading
Free Download

TOAD for Oracle Freeware 9.7


Simplify Oracle database administration tasks
  • Server 1 Brothersoft(US) Click to Download
  • Posted by 1010
    반응형

    In this article I will create a custom Spark Panel component that will look something like this:

    Spark Panel Component Skin

    You can find the working example lower on this page.

    There are five steps that you must take to create a new Flex 4 Skin (for any Spark component):

    1. Create a new MXML component that extends the SparkSkin class
    2. Define the states of the Skin. The default states for most of the components are normal and disabled
    3. Define the HostComponent between Metadata tags
    4. Specify all the graphical elements that are used by the custom Skin
    5. Define the skin parts for the skin

    So the first thing that I did was to create a custom MXML component for the Spark Panel skin. I created this component in the skins folder and I named the custom skin PanelSkin.

    The next step was to define the states of the skin. To see what states are available for any Spark component you should check out the Adobe ActionScript 3.0 Reference for the Adobe Flash Platform online documentation.

    For the Spark Panel custom skin I used four states:

    	<s:states>
    		<s:State name="normal" />
    		<s:State name="disabled" />
    		<s:State name="normalWithControlBar" />
    		<s:State name="disabledWithControlBar" />
    	</s:states>

    The normal and disabled states are the default states when the Panel does not have a Control Bar. The normalWithControlBar and disabledWithControlBar states are used when the Panel is defined with a Control Bar.

    Next we need to specify the HostComponent between Metadata tags. The HostComponent will be the path to the Spark component that will be skinned. In this case: spark.components.Panel:

    	<fx:Metadata>
    		[HostComponent("spark.components.Panel")]
    	</fx:Metadata>

    Next I specified all the graphical elements of the skin:

    	<s:BorderContainer color="0xAAAAAA" cornerRadius="7"
    					   width="100%" height="100%">
    		<s:Rect width="100%" height="45" 
    				topLeftRadiusX="7" topLeftRadiusY="7" topRightRadiusX="7" topRightRadiusY="7"
    				top="0">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#bf0000" />
    						<s:GradientEntry color="#ff0011" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
     
    		<s:Rect bottomLeftRadiusX="7" bottomRightRadiusX="7"
    				y="45"
    				width="100%" height="100%">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#f8f8f8" />
    						<s:GradientEntry color="#CCCCCC" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
     
    		<s:Rect width="100%" height="40" 
    				excludeFrom="normal, disabled"
    				bottomLeftRadiusX="7" bottomLeftRadiusY="7" bottomRightRadiusX="7" bottomRightRadiusY="7"
    				bottom="0">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#3f3f3f" />
    						<s:GradientEntry color="#a5a5a5" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
    	</s:BorderContainer>

    At a glance this looks like a lot of code, but it is actually pretty straight forward. I declared a BorderContainer and inside this another three Rect blocks for the Panel header, Panel body and Panel Control Bar.

    Inside every Rect block I have LinearGradient with different colors for every Rect. In the last Rect I added this code excludeFrom="normal, disabled" which will exclude this Control Bar from the Skin when the panel is declared without the Control Bar.

    The last step is to define the skin parts. The Spark Panel has three skin parts: contentGroup for the Panel body, controlBarGroup for the Panel Control Group and titleDisplay for the Panel Header:

    	<s:Label id="titleDisplay" 
    			 paddingLeft="15" paddingRight="15" paddingTop="15"
    			 color="white"
    			 fontSize="18"
    			 fontWeight="bold"
    			 fontStyle="italic"/>
     
    	<s:Group id="contentGroup">
    		<s:layout>
    			<s:VerticalLayout paddingTop="55" paddingBottom="10" paddingLeft="15" paddingRight="15"
    							  paddingBottom.disabledWithControlBar="55" paddingTop.disabledWithControlBar="55"
    							  paddingBottom.normalWithControlBar="55" paddingTop.normalWithControlBar="55"/>
    		</s:layout>
    	</s:Group>
     
    	<s:Group id="controlBarGroup" bottom="10">
    		<s:layout>
    			<s:HorizontalLayout paddingLeft="5" paddingRight="5"/>
    		</s:layout>
    	</s:Group>

    Ok, that’s all as far as the Panel Custom Skin is concerned. Now I will focus on the applying the Custom Skin to a few Panel instance in the application. To apply a Custom Skin to a Spark component you will use skinClass property like this:

    	<s:Panel id="myPanel1"
    			 skinClass="skins.PanelSkin"
    			 title="My first panel title">

    Here is the resulting application:


    View Source is enabled in the above example. To view the source files right click on the swf and choose “View Source” from the context menu.

    Here is the complete source code for the main application:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    			   xmlns:s="library://ns.adobe.com/flex/spark" 
    			   xmlns:mx="library://ns.adobe.com/flex/mx" 
    			   viewSourceURL="srcview/index.html">
     
    	<s:layout>
    		<s:HorizontalLayout paddingTop="5" horizontalAlign="center" verticalAlign="middle"/>
    	</s:layout>
     
    	<s:Panel id="myPanel1"
    			 skinClass="skins.PanelSkin"
    			 title="My first panel title">
     
    		<mx:Text text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. " 
    				 width="200" />
     
    		<s:controlBarContent>
    			<s:Button label="First Button"/>
    			<s:Button label="Second Button"/>
    		</s:controlBarContent>
     
    	</s:Panel>
     
    	<s:Panel id="myPanel2"
    			 skinClass="skins.PanelSkin"
    			 title="My second panel title">
     
    		<mx:Text text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. " 
    				 width="200" />
     
    	</s:Panel>
     
    </s:Application>

    And here is the complete source code for the Custom Skin Class:

    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" 
    			 xmlns:s="library://ns.adobe.com/flex/spark" 
    			 xmlns:mx="library://ns.adobe.com/flex/mx" 
    			 alpha.disabled="0.5" 
    			 blendMode="normal">
     
    	<s:states>
    		<s:State name="normal" />
    		<s:State name="disabled" />
    		<s:State name="normalWithControlBar" />
    		<s:State name="disabledWithControlBar" />
    	</s:states>
     
    	<fx:Metadata>
    		[HostComponent("spark.components.Panel")]
    	</fx:Metadata> 
     
    	<s:BorderContainer color="0xAAAAAA" cornerRadius="7"
    					   width="100%" height="100%">
    		<s:Rect width="100%" height="45" 
    				topLeftRadiusX="7" topLeftRadiusY="7" topRightRadiusX="7" topRightRadiusY="7"
    				top="0">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#bf0000" />
    						<s:GradientEntry color="#ff0011" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
     
    		<s:Rect bottomLeftRadiusX="7" bottomRightRadiusX="7"
    				y="45"
    				width="100%" height="100%">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#f8f8f8" />
    						<s:GradientEntry color="#CCCCCC" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
     
    		<s:Rect width="100%" height="40" 
    				excludeFrom="normal, disabled"
    				bottomLeftRadiusX="7" bottomLeftRadiusY="7" bottomRightRadiusX="7" bottomRightRadiusY="7"
    				bottom="0">
    			<s:fill>
    				<s:LinearGradient rotation="90">
    					<s:entries>
    						<s:GradientEntry color="#3f3f3f" />
    						<s:GradientEntry color="#a5a5a5" />
    					</s:entries>
    				</s:LinearGradient>
    			</s:fill>
    		</s:Rect>
    	</s:BorderContainer>
     
    	<s:Label id="titleDisplay" 
    			 paddingLeft="15" paddingRight="15" paddingTop="15"
    			 color="white"
    			 fontSize="18"
    			 fontWeight="bold"
    			 fontStyle="italic"/>
     
    	<s:Group id="contentGroup">
    		<s:layout>
    			<s:VerticalLayout paddingTop="55" paddingBottom="10" paddingLeft="15" paddingRight="15"
    							  paddingBottom.disabledWithControlBar="55" paddingTop.disabledWithControlBar="55"
    							  paddingBottom.normalWithControlBar="55" paddingTop.normalWithControlBar="55"/>
    		</s:layout>
    	</s:Group>
     
    	<s:Group id="controlBarGroup" bottom="10">
    		<s:layout>
    			<s:HorizontalLayout paddingLeft="5" paddingRight="5"/>
    		</s:layout>
    	</s:Group>
     
    </s:SparkSkin>
    Posted by 1010
    반응형

    The <mx:Panel> tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

      <mx:Panel
       Properties
       layout="vertical|horizontal|absolute"
       status=""
       title=""
       titleIcon="null"
      
       Styles
       borderAlpha="0.4"
       borderThicknessBottom="NaN"
       borderThicknessLeft="10"
       borderThicknessRight="10"
       borderThicknessTop="2"
       controlBarStyleName="null"
       cornerRadius="4"
       dropShadowEnabled="true|false"
       footerColors="null"
       headerColors="null"
       headerHeight="Based on style of title"
       highlightAlphas="[0.3,0]"
       horizontalAlign="left|center|right"
       horizontalGap="8"
       modalTransparency="0.5"
       modalTransparencyBlur="3"
       modalTransparencyColor="#DDDDDD"
       modalTransparencyDuration="100"
       paddingBottom="0"
       paddingTop="0"
       roundedBottomCorners="false|true"
       shadowDirection="center|left|right"
       shadowDistance="2"
       statusStyleName="windowStatus"
       titleBackgroundSkin="TitleBackground"
       titleStyleName="windowStyles"
       verticalAlign="top|middle|bottom"
       verticalGap="6"
      
       Effects
       resizeEndEffect="Dissolve"
       resizeStartEffect="Dissolve"
       >
          ...
          child tags
          ...
      </mx:Panel>
      

    View the examples

     

    Posted by 1010
    98..Etc/Etc...2013. 1. 11. 10:17
    반응형

    출처 : http://jaures.egloos.com/2290270 

     

    Eclipse를 사용하다 보면 이런저런 이유로 속도가 느려지는 경험을 다 한 두번씩은 해봣을 것이다.
    SVN repository에서 업데이트를 하는경우 build 작업하는 경우, 서버를 띄워서 작업을 하고 있는데 eclipse가 사용하는 메모리가 과도하게 늘어나서 문제가 생기는 경우 등등...

    확실한 해결책은 아니겠지만, 나름대로 쾌적한(?) 환경에서 eclipse를 사용할 수 있도록 도와주는 방법을 몇가지 소개해본다.


    1. Close Project

    여러개의 project를 동시에 작업하는 경우에는 svn에서 update만 받아도 관련된 모든 project가 다시 빌드 작업을 진행해버려 그동안은 넋놓고 멍하니 기다리거나 작업의 리듬이 깨져버리는 경우가 많았다. 간혹 elcipse를 다시 재시작 해야하는 경우에도 재시작하는 시간이 너무 오래걸려 재시작을 고민해야 하는 경우도 종종 있었다.


    이런 경우에는 해당 project를 닫아버리는게 큰도움이 되는데, 이건 아주 간단하게 바로 작업에 사용할 project가 아니라면 Package Explorer에서 해당 프로젝트의 컨텍스트 메뉴에서 "Close Project"를 해버리면 된다. 작업할 때에는 다시 컨텍스트 메뉴에서 "Open Proejct"를 하면 된다.


    2. Spelling 검사 끄기

    필요한 경우도 있겠지만, 대다수의 경우에는 철자검사를 할필요는 없을것 같다. 철자검사를 해제하면 에디터상에서 철자에 대한 검사를 실행하지 않기 때문에 조금은 더 빠르게 작업을 할수 있다.


    Window > Preferences > General > Editors > Text Editors > Spelling 에서 Enable spell checking 체크박스를 해제하면 된다.


    3. Startup and Shutdown

    Eclipse plug-in을 이것저것 설치해서 사용하다보면 시작시에 불필요한 작업이 많아진다. 꼭 그런것은 아니지만 시작시에 plug-in의 업데이트를 확인한다거나 plug-in의 특정 모듈을 activate 한더거나 등등.

    작업에 꼭 필요하지 않다고 생각되는 것들은 시작 항목에서 빼버리게 되면 그만큼 eclipse의 시작 실행속도가 빨라지게 된다. 이 항목에서는 또한 eclipse 종료시에 대한 설정도 할수 있다.


    Window > Preferences > General > Startup and Shutdown > Plug-ins activated on startup 에서 사용하지 않을 항목에 대해 체크박스를 해제하면 된다.


    4. Eclipse status memory monitor

    Eclipse는 JRE 위에서 실행되는 java 프로그램이라서 eclipse를 실행한 후에 일정 기간이 지나게 되면 Gabarge Collection을 하게 된다. 더군다나 eclipse는 많은 메모리를 사용하는 것으로 악명(?)이 높기 때문에 GC가 제때 수행되지 않거나 주기가 길어지는 경우 프로그램을 실행할 메모리 자체가 줄어들어 작업 자체가 힘들어진다.

    이럴 경우 Eclipse status memory monitor plug-in을 사용해 메모리가 모자르다 싶으면 바로 GC를 강제로 수행해 메모리를 확보할 수 있다. 또한 현재 Eclipse가 사용하고 있는 메모리의 상태를 직접 확인할 수 있으므로 아무런 이유없이 eclipse가 느려지는 답답함을 해소(?)할 수도 있다.




    5. Validation

    보통 view 작업을 진행하다 보면, 여러가지 코드가 한 파일에 뒤섞이게 된다. JSP 파일안에 html, css, javascript, java 등의 코드들이 뒤섞에 있다보면 validation이 크게 의미가 없게 되는 경우가 있는데 이럴 경우에는 굳이 validation을 할필요가 없어지게 된다. Validation은 에디터상에서 말그대로 문법에 대한 오류를 실시간으로 검사해 알려주는 것이기 때문에 validation만 해제해도 eclipse 작업속도에 그 만큼의 영향을 미치게 된다.


    Window > Preferences > General > Validation > Validator 항목에서 문법검사를 하지 않을 항목에 대해 체크를 해제하면 된다.
    Posted by 1010
    80.모바일 웹앱2012. 12. 6. 16:22
    반응형

    출처 : http://stove99.tistory.com/4

     

    Jquery 를 쓰면 쓸수록 이걸 만든 사람들은 천재라는 생각을 하게된다.

    이클립에서 Jquery 코딩을 할때 $("div"). 요래 쩜을 찍었을때 쓸 수 있는 메소드들이 뽓 튀어나오도록 해보자.

    jqueryWTP 라는 이클립 훌러그인인데 이건 다른 훌러그인처럼 Install New Software 로 설치를 간단하게 할수 없다.

    찾아보니까 aptana 라고 다른 훌러그인도 있던데 이것저것 설치할것도 많고 왠지 *.js 파일에만 될것 같기도 해서(실제로 안써봤기 때문에 잘 모른다. *.js 파일 말고도 jsp 나 html 에서 될지도 모름!!!)




    ※ 설치전 이클립을 종료한다음에 설치, 설치한 이클립스는 Helios Service Release 2 버전임.

    뭐 일단 설치하는 방법은

    첫번째 - 훌러그인을 다운로드 받는다. [다운!] 나는 jqueryWTP1.20foEN.jar 이걸 다운받았다.

    두번째 - 다운받은 jar 파일을 실행한다. cmd 창을 열고 java -jar e:\jqueryWTP1.20foEN.jar 를 실행
    ※ 다운로드를 E: 드라이브로 받았음.



    세번째 -
    Jar 파일 선택 : [이클립스설치디렉토리]\plugins 디렉토리 안에 있는 org.eclipse.wst.jsdt.core_xxxxxx.jar 파일 선택
    Output Dir : 패치된 org.eclipse.wst.jsdt.core_xxxxx.jar 파일이 생성될 디렉토리
    Generate 클릭



    네번째 - 패치된 org.eclipse.wst.jsdt.core_xxxxx.jar 파일을 [이클립스설치디렉토리]\plugins 디렉토리에 복사해서 파일 덮어쓰기

    다섯번째 - [현재 쓰고 있는 workspace 디렉토리]\\.metadata\.plugins\org.eclipse.wst.jsdt.core 디렉토리 삭제

    이렇게 하면 설치가 끝난다.

    이클립스를 다시 시작해 보면 이제부터 $("div") 에서 쩜을 찍으면 Code Assist 기능이 적용된다~~~



    ※ 만약 Code Assist 가 되지 않으면 Project > Properties > Project Facets 에 가서 JavaScript 를 체크해 주셈~

     

    Posted by 1010
    80.모바일 웹앱2012. 12. 6. 16:11
    반응형

    jQueryWTP 1.2.0

    Bookmark and Share

    Details Group Tabs

    Details

    jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.
    Eclipse WTP support javascript code content assistance,but does not support jQuery.
    jQueryWTP is a tool make Eclipse WTP support jQuery code content assistance.

    html5 is also supported

    supported eclipse version is eclipse 3.5,eclipse 3.6

    version 0.40 add support for multi html canvas context variable names
    version 0.50 add support for jquery 1.5 Deferred callback management system
    version 1.0.0 released this version fix a lot of bugs for jquery return type.
    version 1.1.0 released this version add support for jquery 1.5 api
    this version add support jquery1.6 api

    Categories:
    Hide Additional Details
    Version Number:
    1.2.0
    Eclipse Versions:
    3.5,3.6
    Date Updated:
    13 June 2011
    Development Status:
    Beta
    License:
    Free for non-commerical use
    Screenshots
    Metrics
    Clickthroughs 000000 22
    Month Ranking Installs Clickthroughs
    12/12 0 7
    11/12 0 83
    10/12 0 93
    9/12 0 91
    8/12 0 85
    7/12 0 119
    6/12 0 86
    5/12 0 115
    4/12 0 105
    3/12 0 145
    2/12 0 139
    1/12 0 135
    View Data for all Listings
    Errors

    Unsuccessful Installs

    Unsuccessful Installs in the last 7 Days:0

    Download last 500 error reports (CSV)

    Reviews

    Login to post comments.

    this is old download url

    Submitted by jim liu on

    move to google project hosting,because sourceforge lost my user info

    Posted by 1010
    01.JAVA/Java2012. 12. 6. 10:25
    반응형

    -- class 주석

    /**
    * <PRE>
    * 보세운송 조회를 한다.
    * </PRE>
    * @author anhanho
    * @version 1.0
    * @since 13/10/2011
    * @modified
    * @modifier
    */

     

    -- method 주석

    /**
      * @description 행정몰수  게시 (5일 ) + 48시간을  지나면  행정몰수확정이 된다.
      * @param List arg0
      * @return void
      * @throws Exception
      */


     

    Posted by 1010
    80.모바일 웹앱2012. 12. 6. 02:09
    반응형

    1. adt-bundle-windows-x86\sdk\tools 에서 tools 폴더를 tools_temp 로 복사함


    2. tools_temp > android.bat 실행 


    3. android.bat 종료(업데이트 한번은 해줌)


    4. 작업관리자 프로세스에서 adb.exe 프로세스 강제 종료 


    5. tool_temp 폴더 삭제


    6. tools 안에 android 다시 실행


    7. update 후 AVD Manager 실행


    이렇게 해도 안되면... java 환경설정이 꼬여있을수 있으니 다시 한번 확인


    자바 설정후 tools 밑에 android.bat 다시 실행 


    ex)



    Posted by 1010