티스토리 뷰
반응형
동일한 노트북에서 도커 환경으로 각각 테스트한 결과입니다.
MariaDB ColumnStore 10.5.12
1. 테이블 생성
CREATE TABLE `tt_trade` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT NULL,
`c` varchar(10) DEFAULT NULL,
`d` varchar(10) DEFAULT NULL,
`e` integer
) ENGINE=ColumnStore DEFAULT CHARSET=latin1;
2. 데이터 50만건 넣기
2-1. jdbc option = jdbc:mariadb://127.0.0.1:3306/mobdw?rewriteBatchedStatements=true
2-2. Batch처리로 1000건 식 입력 후 커밋
2-3. 처리 속도: 342 초
3. 데이터 조회 속도 (최초)
select count(1), sum(e)
from tt_trade;
>> 500000 125000250000
>> 74ms
4. 데이터 갱신 속도
update tt_trade
set a = concat('a', a)
,e = e+1
where 1=1
;
14.762 초
ClickHouse 22.1.3.7
1. 테이블 생성
CREATE TABLE dev4u.tt_trade (
`a` varchar(10) ,
`b` varchar(10) ,
`c` varchar(10) ,
`d` varchar(10) ,
`e` integer
) ENGINE = MergeTree
ORDER BY a
SETTINGS index_granularity = 8192;
;
2. 데이터 50만건 넣기
2-1. jdbc option = jdbc:mariadb://127.0.0.1:3306/mobdw?rewriteBatchedStatements=true
2-2. Batch처리로 1000건 식 입력
2-3. 처리 속도: 2 초
3. 데이터 조회 속도 (최초)
select count(1), sum(e)
from tt_trade
>> 500000 125000250000
>> 10ms
4. 데이터 갱신 속도
update tt_trade
set a = concat('a', a)
,e = e+1
where 1=1
;
Cannot UPDATE key column `a`. (CANNOT_UPDATE_COLUMN)
;
update tt_trade
set b = concat('b', b)
,e = e+1
where 1=1
;
73 ms
Conclusion by TEST
"ClickHouse Gets a Victory"
TEST Code = https://github.com/dev4u-korea/DBTest
<< MariaDB ColumeStore TIPS >>
Here are some tips for fast inserting data into a MariaDB ColumnStore database using JDBC:
- Use batch inserts: One of the most effective ways to improve insert performance is to use batch inserts. Instead of inserting data one row at a time, you can group multiple rows together into a single batch and insert them all at once. This reduces the overhead of sending multiple individual insert statements to the database and can significantly improve performance.
- Use the LOAD DATA statement: The LOAD DATA statement in MariaDB ColumnStore is specifically designed for bulk loading of data. This statement can be used to efficiently insert data from a CSV file into a MariaDB ColumnStore table. The LOAD DATA statement is highly optimized and can provide much faster performance than traditional insert statements.
- Use the rewriteBatchedStatements option: The rewriteBatchedStatements option in the MariaDB Connector/J JDBC driver can be used to optimize batch statements. When this option is set to true, the driver will group multiple similar SQL statements into a single batch, reducing the overhead of multiple individual statement executions.
- Disable auto-commit: By default, MariaDB Connector/J automatically commits changes after each statement execution. To improve performance, it is recommended to disable auto-commit and explicitly manage transactions yourself. This allows you to group multiple insert statements into a single transaction and commit them all at once, reducing the overhead of committing multiple individual transactions.
- Use connection pooling: Connection pooling can help to reduce the overhead of establishing new database connections for each insert operation. A connection pool allows you to reuse existing database connections instead of creating a new connection for each operation. This can result in a significant performance improvement for large batch insert operations.
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 빈센트 반 고흐
- VARIDESK
- 화분벌레
- 로니카 BCS
- 코라나 19
- 브리다 정수기
- 매직 트랙패드2
- 카카오 에드
- 유가바이트디비
- 별잉 빛나는 밤
- 르세라핌
- Pixel Pals
- 솔리드 쿨론
- 고체 향수
- 루미큐브 종류
- Sybase IQ
- 파나소닉 비데 DL-EH10KWS
- 남설 팔찌
- 홈 오피스
- 배당급
- weka
- node.js
- 별이 빚나는 밤
- JMW 헤어드라이기기
- 오미크론
- GKRS
- Life Chair
- 톡토기
- yugabyteDB
- 증권정보포털
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함