Background Image
조회 수 17565 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

질의 튜닝을 할때 종종 바인딩되는 값을 모르는 상태에서 질의 플랜결과를 보고자 하는 경우가 있습니다.

주로 프로그램 소스에 preparestatement 형태로 작성된 질의 문을 발췌해서 플랜을 보려고 경우가 이에 해당할 입니다.

예를 들면 select * from participant where host_year = ?; 같은 질의를 수행하여 플랜을 보고자 하는 경우가 되겠죠.
이런 경우에 

l  CSQL 인터브리터의 옵션 -e 옵션을 사용하여 DB 접속하고

l  set optimization level 514(또는 513, 257, 258 자세한 내용은 큐브리드 매뉴얼>CUBRID SQL 설명서>질의 최적화> 쿼리 실행 계획 보기 참조) 실행하여 질의 플랜 보기 설정을

l  질의를 수행하면 됩니다.

-e 옵션은 에러가 발생하더라도 세션을 종료하지 않고 계속 실행하라는 옵션입니다.

아래는 사용예제 입니다.
host_year 컬럼에 비교되는 값으로 상수가 아닌 '?'을 입력하여도 플랜 정보가 출력됨을 확인할 수 있습니다.

C:>csql -e demodb  

         CUBRID SQL Interpreter 

Type `;help' for help messages. 

csql> set optimization level 514

csql> ;x 

Current transaction has been committed. 

1 command(s) successfully processed. 

csql> select * from participant where host_year = ?

csql> ;x

Join graph segments (f indicates final):

seg[0]: [0]

seg[1]: host_year[0] (f)

seg[2]: nation_code[0] (f)

seg[3]: gold[0] (f)

seg[4]: silver[0] (f)

seg[5]: bronze[0] (f)

Join graph nodes:

node[0]: participant participant(916/16) (sargs 0)

Join graph terms:

term[0]: participant.host_year= ?:0  (sel 0.2) (sarg term) (not-join eligible) (indexable host_year[0]) (loc 0) 

Query plan: 

iscan

    class: participant node[0]

    index: fk_participant_host_year term[0]

    cost:  fixed 2(0.0/2.0) var 4(0.5/3.0) card 183 

Query stmt: 

select participant.host_year, participant.nation_code, participant.gold, participant.silver, participant.bronze from participant participant where participant.host_year= ?:0 

In the command from line 1, 

ERROR: Too few input host variables provided. 

0 command(s) successfully processed.

csql>



 


  1. ODBC 드라이버를 이용한 Prepare 사용하기.

    Date2009.06.16 Category응용개발 Byseongjoon Views19591
    Read More
  2. csql 데이터 입력방법

    Date2009.06.09 Category운영관리 By정만영 Views213384
    Read More
  3. 오라클 바이딩 변수와 큐브리드 인터프리터 변수를 사용한 경로 표현식

    Date2009.06.09 Category질의작성 By정만영 Views13484
    Read More
  4. 조건절에 상수가 아닌 ? 가 있는 질의 플랜보는 방법

    Date2009.05.28 Category기타 By손승일 Views17565
    Read More
  5. TIME_TO_KILL과 SESSION_TIMEOUT에 대한 정리

    Date2009.05.27 Category운영관리 Bycubebridge Views13191
    Read More
  6. windows vista 환경의 csql에서 ;edit 실행시 오류발생하는 경우

    Date2009.05.27 Category기타 By손승일 Views16686
    Read More
  7. windows 에서 CUBRID 설치후 CUBRID manager client 최초 연결시 연결 오류 발생 대처 방법

    Date2009.05.21 CategoryCUBRID 매니저 By남재우 Views17714
    Read More
  8. csql에서 Java SP를 이용 조회 시 한글 깨짐현상 조치방법

    Date2009.05.21 Category기타 Bycubebridge Views21044
    Read More
  9. cubrid: error while loading shared libraries 에러가 발생했을 경우 대처

    Date2009.05.19 Category기타 By웁쓰 Views22440
    Read More
  10. windows에서의 Build 오류 발생 시 조치방법

    Date2009.05.19 Category기타 Bycubebridge Views14255
    Read More
  11. CM이 아닌 서버(console)상의 쿼리 결과값을 저장하는 방법

    Date2009.05.19 Category운영관리 Bycubebridge Views20200
    Read More
  12. utf-8 데이터 like 검색 시 설정

    Date2009.05.12 Category기타 By손승일 Views18453
    Read More
  13. Database(db이름) is running is standalone mode 오류가 뜰 경우

    Date2009.04.29 CategoryCUBRID 매니저 By시난 Views28490
    Read More
  14. LIKE 검색에서 INDEX_SCAN사용 하기

    Date2009.04.17 Category질의작성 Byjanus Views21809
    Read More
  15. 막무가내 DBA의 DISK 장애 대처

    Date2009.04.16 Category운영관리 By정병주 Views20444
    Read More
  16. PHP에서 prepared statement 사용하기

    Date2009.04.16 Category응용개발 ByPrototype Views21455
    Read More
  17. XE(구 제로보드XE) 에서 로그인이 되지 않을 경우 해결법

    Date2009.04.16 Category기타 ByPrototype Views26993
    Read More
  18. jdbc에서 질의 플랜정보 보는 방법

    Date2009.04.15 Category응용개발 By손승일 Views15842
    Read More
  19. 스키마에서 한글 사용하는 방법

    Date2009.04.14 Category질의작성 Byseongjoon Views15362
    Read More
  20. java.lang.OutOfMemoryError 처리 방법

    Date2009.04.13 CategoryCUBRID 매니저 Byjanus Views17880
    Read More
Board Pagination Prev 1 ... 5 6 7 8 9 10 11 12 13 14 Next
/ 14

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales