https://github.com/lc044/test
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lc044/test
- Owner: LC044
- Created: 2024-10-11T09:10:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-12T10:35:51.000Z (over 1 year ago)
- Last Synced: 2025-01-23T06:29:09.687Z (over 1 year ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 在线创建索引测试
## 安装依赖
```shell
pip install -r requirements.txt
```
## 修改openGauss配置
改成本地openGauss对应配置
./database/opengauss.py
```python
connection_params = {
'host': '127.0.0.1',
'port': '33000',
'dbname': 'postgres',
'user': 'shuaikangzhou',
'password': 'zhou@123'
}
```
有问题的话可以尝试把用户名和密码字段删了,获取把端口和主机删了,都试试
## 运行main.py
```shell
python main.py
```
## 其他配置
OpenGauss.roll_back_rate: 回滚率,每个DML操作都有一定概率回滚,可以通过该参数调整回滚率
OpenGauss.init_database: 初始化表,修改这部分可以改变表的数据
```python
og = OpenGauss(self.dbname)
# op_num: 操作的个数
# op_rate: insert,delete,update的比例
og.random_operation(op_num=100,op_rate=[3,3,4])
og.close()
```
可以通过阶段二和阶段三的操作个数和操作比例控制不同的情况,例如,阶段二全设置为insert,阶段三全设置成delete,就很容易出现阶段三删除阶段二插入的数据这种情况。