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
운영게시판
최근게시물
Cache Q&A 1066 게시물 읽기
No. 1066
[SQL] Index 재생성하기 소스레벨 분석자료
작성자
글로벌직접액세스
작성일
2010-02-17 19:19
조회수
10,005

혹시, 글로벌에 직접 액세스 하시는 분들 중, Cache SQL에 나오는 비트맵 인덱스를 활용하시는 분 있으면 정보 공유 희망합니다.

우선, 인덱스를 생성하는 것하고 활용하는 것이 필요할 듯 한데, 조금씩 정보 공유해 나가면 뭔가 만들어 볼 수 있지 않을까 생각합니다. 어떤 자료든 미리 감사드립니다.

지방도시의 한 케세디비 매니아

 

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

비트맵 인덱스를 생성하는 코드는 %Library.Persistent 클래스에 %BuildIndices() 라는 메소드를 참고하시면 좋을듯 합니다. 아래 문서 설명내용 참조.

• classmethod %BuildIndices(idxlist As as %Status %List = "", autoPurge As %Boolean = 0, lockExtent As %Boolean = 0)

Rebuilds all entries for each index specified in the idxlist argument. If idxlist is empty then all indices that originate in the class are rebuilt. If autoPurge is true then the indices contained in idxlist will be purged before they are built. If lockExtent is true then an extent lock will be acquired before the indices are built. If the lock cannot be acquired then an error is returned. The lock is released after the index build is completed.

Returns a %Status value indicating success or failure.

아래는 User.Person 클래스의 SexIdx에 대해 생성된 코드입니다:

 %BuildIndices(idxlist="",autoPurge=0,lockExtent=0) public {
$ZTrap="CatchError",locked=0,sc=1,sHandle=$c(0,0)
for ptr=1:1:$listlength(idxlist) if '$d(^oddCOM("User.Person","i",$list(idxlist,ptr))) set sc=$$Error^%apiOBJ(5066,"User.Person::"_$list(idxlist,ptr)) continue if ('sc) quit sc }
lockExtent sc=##class(User.Person).%LockExtent(0) ('sc) sc else locked=1 }
autoPurge sc = ##class(User.Person).%PurgeIndices(idxlist) ('sc) quit sc }}
if (idxlist="")||($listfind(idxlist,"SexIdx")) set $Extract(sHandle,2)=$c(1) }
If (($lf(idxlist,"$Person")) || ((idxlist="") && ('##class(User.Person).%BMEBuilt())))||(($Ascii(sHandle,2))&&'##class(User.Person).%BMEBuilt()) $Extract(sHandle,1)=$c(1) }
Set id=""
BSLoop Set id=$order(^User.PersonD(id)) Goto:id="" BSLoopDun
Set bsv0N1=$Get(^User.PersonD(id))
Set pidchunk=id\64000+1,pidoffset=id#64000+1
If $Ascii(sHandle,1) {
Set $bit(^User.PersonI("$Person",pidchunk),pidoffset)=1
}
If $Ascii(sHandle,2) {
Set $bit(^User.PersonI("SexIdx",$zu(28,$listget(bsv0N1,9),7,32768),pidchunk),pidoffset)=1
}
Goto BSLoop
BSLoopDun
If $A(sHandle,1) Set subextent="" For  Set subextent=$o(^oddMAP("User.Person","Z",subextent)) Quit:subextent=""  Set:'$zobjclassmethod(subextent,"%BMEBuilt",.subbme) sc=$zobjclassmethod(subextent,"%BuildIndices",$listbuild(subbme))
locked ##class(User.Person).%UnlockExtent(0) }
QUIT 1

 

배영민(kbae)님이 2010-02-18 18:32에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
1070[웹-Zen] fileUpload 샘플코드
앙상블
2010-03-09
10015
1069파일 Open 모드 파라미터
CacheDB
2010-03-09
15249
1068[웹-Zen] fileUpload 사용시 IE브라우저에 파일이름 [1]
IE시로
2010-02-19
10003
1066[SQL] Index 재생성하기 소스레벨 분석자료 [1]
글로벌직접액세스
2010-02-17
10005
1065[웹-CSP] 첨부파일 업로드 하는 법 [1]
CSP개발자
2010-02-17
10098
1064%Text 타입 값 가져오기 [1]
검색
2010-02-17
10376
1063[COS] SSN 필드에 한국 주민번호를 생성되게 하려면? [1]
엔트리학생
2010-02-17
10716
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.051초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다