database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
ㆍSybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Sybase Q&A 2025 게시물 읽기
No. 2025
인덱스 plan인대 두개의 차이좀 알려주세용...^^;;
작성자
천적
작성일
2007-09-03 17:02ⓒ
2007-09-04 08:48ⓜ
조회수
7,039

        FROM TABLE 

            xxx..aaaaa 

            a

        Nested iteration.

        Index : aaaaa1

        Forward scan.

        Positioning at index start.

        Using I/O Size 8 Kbytes for index leaf pages.

        With LRU Buffer Replacement Strategy for index leaf pages.

        Using I/O Size 8 Kbytes for data pages.

        With LRU Buffer Replacement Strategy for data pages. 


------------------------------------------------------------------------


        FROM TABLE 

            xxx..aaaaa

            a

        Nested iteration.

        Index : aaaaa1

        Forward scan.

        Positioning by key.

        Keys are:

            borntime  ASC

        Using I/O Size 8 Kbytes for index leaf pages.

        With LRU Buffer Replacement Strategy for index leaf pages.

        Using I/O Size 8 Kbytes for data pages.

        With LRU Buffer Replacement Strategy for data pages. 


두개 플랜의 차이가 무엇인가요.??


쿼리상의 차이는 borntime 이 nonclustered index로 잡혀있는대 

   위의 쿼리는 borntime between convert(date, '20070801') and convert(date, '20070831') 로 했고요 

아래의 쿼리는 borntime between convert(datetime, '20070801'+' 00:00:00') and convert(datetime, '20070831'+' 23:59:59') 이 차이뿐입니다.


두개의 플랜의 차이와 속도차이가 있나요? 


그럼 수고하세요~~~ 화이팅...~!!!

이 글에 대한 댓글이 총 3건 있습니다.

없을것 같습니다


convert(varchar(12),borntime,102) between '20070801' and '20070831'


이러면 문제가 되지만



위의 2개 쿼리 모두 문제가 되지 않습니다

지연님이 2007-09-04 08:59에 작성한 댓글입니다. Edit

답변 감사합니다...^^;; (할렐루야~~)

^^; 근데 정말로 죄송한 말씀이지만... 저기에 나온 plan의 의미를 알고 싶어서 올린 질문이라..

그쪽에 대한 답이 없어서요...^^;;

바쁘시더라도...^^;;

답변주시면 감사하겠습니다.(나무아미 타불~~)

ps. convert(varchar(8),borntime,112) between '20070801' and '20070831'
이런식으로 하면 어떤 문제가 있다는건지도..^^;; 어떻게 돌기 때문에 문제가 있는건가요??

여러분 모두에게 축복이 함께하시길...*^^*

천적님이 2007-09-04 14:41에 작성한 댓글입니다.
이 댓글은 2007-09-04 14:43에 마지막으로 수정되었습니다. Edit

borntime between convert(date, '20070801') and convert(date, '20070831')

borntime은 datetime type이기 때문에
위문장은
convert(date, borntime) between convert(date, '20070801') and convert(date, '20070831')로
변경됩니다.

borntime의 type이 convertion되었기 때문에 index를 탈 수 없습니다.
첫번째 쿼리는 index fullscan하는 쿼리이기 때문에 무지 느릴듯...


borntime between '20070801'+' 00:00:00' and '20070831' +' 23:59:59' 로 고쳐서 사용하면 됩니다.
char type은 자동으로 datetime type로 convertion 됨

index tree는 column의 고유 type으로 tree가 구성됩니다

index를 타야되는 column의 값을 변경(convert, substring 등)하면
index tree 를 탈 수 없습니다.

따라서 DB는 한개씩 레코드를 읽어와서 값을 변경하고 
이게 조건에 맞는지 확인하게 됩니다 ( index fullscan 혹은 table fullscan 함)

영빈~(backfish)님이 2007-09-04 16:40에 작성한 댓글입니다.
이 댓글은 2007-09-04 16:50에 마지막으로 수정되었습니다.
[Top]
No.
제목
작성자
작성일
조회
2030[긴급] 오라클 rownum() partion 을 sybase로 변환 ? 메일 주소 올렸습니다. [4]
김진일
2007-09-05
8401
2029SYBASE에서 예외처리문장이 어떻게 되나요? [1]
사이초보에요
2007-09-04
7168
2026ODBC연결 테스트하는데 자꾸 에러가 발생하네요.. [2]
Sybase초보
2007-09-04
13491
2025인덱스 plan인대 두개의 차이좀 알려주세용...^^;; [3]
천적
2007-09-03
7039
2024사이베이스 디비가 기동안되는데 .... 디비파일가지고 복구 가능한가요.. [6]
지나가다가
2007-08-31
7899
2023asp와 기존 sysbase db를 연동하는방법 질문????? [1]
김명기
2007-08-29
6500
2022쉘스크립트에서 프로시저 실행하고 싶어요. [1]
초보자
2007-08-28
8479
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.021초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다