sqllite DB 에 index 생성하기
sqlite DB 에 DB Browser for SQLite 없이 인덱스를 생성해야하는 일이 생겼다.
해결.
SQLite Download Page
SQLite Download Page
Templates (1) and (2) are used for source-code products. Template (1) is used for generic source-code products and templates (2) is used for source-code products that are generally only useful on unix-like platforms. Template (3) is used for precompiled bi
sqlite.org
sqlite 다운로드 사이트에서 sqlite3.exe를 다운 받은 후에
인덱스 생성 스크립트 파일을 만듬
파일 내용은 "CREATE INDEX idx_tbl ON tbl (col1, col2);" 정도면 됨
명령 프롬프트 창 켜고 아래 처럼 수행해주면 된다.
[path]\sqlite3.exe [path]\[target_db].db ".read test.sql"
정상 수행시 잠시 멈췄다가 콘솔창이 돌아오고 DB를 확인해보면 인덱스가 잘생겼음을 알 수 있다.
insert/update/delete 등 처리가 필요한 스크립트도 동일하게 처리하면 된다.
----------------------------------
I had to create an index in the sqlite DB without DB Browser for SQLite.
solution.
SQLite Download Page
SQLite Download Page
Templates (1) and (2) are used for source-code products. Template (1) is used for generic source-code products and templates (2) is used for source-code products that are generally only useful on unix-like platforms. Template (3) is used for precompiled bi
sqlite.org
After downloading sqlite3.exe from the sqlite download site
create index creation script file
The file content is "CREATE INDEX idx_tbl ON tbl(col1, col2);" Enough
Open the Command Prompt window and do the following.
[path]\sqlite3.exe [path]\[target_db].db ".read test.sql"
During normal operation, it stops for a while, then the console window returns, and if you check the DB, you can see that the index looks good.
Scripts that require processing such as insert/update/delete can be processed in the same way.