当前位置: 首页 > news >正文

postgressql——子事务可见性判断 性能问题(8)

子事务可见性判断 & 性能

测试SQL

BEGIN;
PREPARE sel(integer) ASSELECT count(*)FROM contendWHERE id BETWEEN $1 AND $1 + 100;
PREPARE upd(integer) ASUPDATE contend SET val = val + 1WHERE id IN ($1, $1 + 10, $1 + 20, $1 + 30);SAVEPOINT a;
\set rnd random(1,990)
EXECUTE sel(10 * :rnd + :client_id + 1);
EXECUTE upd(10 * :rnd + :client_id);SAVEPOINT a;
\set rnd random(1,990)
EXECUTE sel(10 * :rnd + :client_id + 1);
EXECUTE upd(10 * :rnd + :client_id);...SAVEPOINT a;
\set rnd random(1,990)
EXECUTE sel(10 * :rnd + :client_id + 1);
EXECUTE upd(10 * :rnd + :client_id);DEALLOCATE ALL;
COMMIT;

子事务:tps = 167.382164

pgbench -f subtrans.sql -n -c 6 -T 600transaction type: subtrans.sql
scaling factor: 1
query mode: simple
number of clients: 6
number of threads: 1
duration: 600 s
number of transactions actually processed: 100
http://www.lryc.cn/news/359259.html

相关文章:

  • 20240531在飞凌的OK3588-C开发板上跑原厂的Buildroot测试USB摄像头
  • 从0开始学统计-什么是回归?
  • Element-ui使用上传时弹框选择文件类型
  • 原生小程序一键获取手机号
  • ARM虚拟机安装OMV
  • 【协议开发系列】梳理关于TCP和UDP两种协议的区别和使用场景
  • vue blob实现自定义多sheet数据导出到excel文件
  • Python—面向对象小解(3)
  • Nginx超时时间
  • Imgs,GT,Edge,Gradient_all,Gradient_Foreground
  • 自学成才Flutter 弹性布局、线性布局
  • Part 3.1 深度优先搜索
  • 前端Vue小兔鲜儿电商项目实战Day03
  • ORACLE 查询SQL优化
  • Ansible03-Ansible Playbook剧本详解
  • Qt-qrencode生成二维码
  • 长安链使用Golang编写智能合约教程(三)
  • Vercel deploy- Nextjs project error-URL link-env variable
  • Java | Leetcode Java题解之第123题买卖股票的最佳时机III
  • Ubuntu22.04之扩展并挂载4T硬盘(二百三十三)
  • Redis实现延迟队列
  • 如何准确查找论文数据库?
  • 翻译《The Old New Thing》- What a drag: Dragging a virtual file (IStream edition)
  • 【FPGA】Verilog语言从零到精通
  • unity打包的WebGL部署到IIS问题
  • GPT-4o:人工智能的新里程碑
  • 发现一个ai工具网站
  • 第二十五章新增H5基础(以及视频~兼容)
  • [英语单词] production quality
  • windows安装nodeJs,以及常用操作