crt oracle查看执行计划,postgresql性能优化最佳综合案例实践

编程入门 行业动态 更新时间:2024-10-24 16:26:28

crt oracle查看执行计划,postgresql<a href=https://www.elefans.com/category/jswz/34/1771266.html style=性能优化最佳综合案例实践"/>

crt oracle查看执行计划,postgresql性能优化最佳综合案例实践

postgresql性能优化最佳综合案例实践-存储

美河学习在线

PostgreSQL 性能优化最佳综合案例实践

Digoal.Zhou

【前言】

本文建立了一个包含INSERT, UPDATE, SELECT 数据库请求的简单的业务模型, 并使用pgbench 模拟业务请求,

详细的阐述PostgreSQL 数据库的调优过程.

【正文】

【软件环境】

CentOS 5 x64

PostgreSQL 9.1.3

plproxy 2.3

pgbouncer 1.4.2

【测试模型】

设计一个包含INSERT, UPDATE, SELECT 语句的业务模型用于本优化案例.

业务逻辑 :

美河学习在线

【测试表】

create table user_info

(userid int,

engname text,

cnname text,

occupation text,

birthday date,

signname text,

email text,

qq numeric,

crt_time timestamp without time zone,

mod_time timestamp without time zone

);

create table user_session

(userid int,

logintime timestamp(0) without time zone,

login_count bigint default 0,

美河学习在线

logouttime timestamp(0) without time zone,

online_interval interval default interval '0'

);

create table user_login_rec

(userid int,

login_time timestamp without time zone,

ip inet

);

create table user_logout_rec

(userid int,

logout_time timestamp without time zone,

ip inet

);

【初始化数据】

insert into user_info (userid,engname,cnname,occupation,birthday,signname,email,qq,crt_time,mod_time)

select generate_series(1,

'digoal.zhou',

'德哥',

'DBA',

'1970-01-01'

,E'公益是一辈子的事, I\'m Digoal.Zhou, Just do it!',

'digoal@126',

276732431,

clock_timestamp (),

NULL ;

insert into user_session (userid) select generate_series (1;

set work_mem='2048MB';

set maintenance_work_mem='2048MB';

alter table user_info add constraint pk_user_info primary key (userid);

alter table user_session add constraint pk_user_session primary key (userid);

【业务函数】

-- 模拟用户登录的函数

create or replace function f_user_login

(i_userid int,

OUT o_userid int,

OUT o_engname text,

OUT o_cnname text,

OUT o_occupation text,

美河学习在线

OUT o_birthday date,

OUT o_signname tex

更多推荐

crt oracle查看执行计划,postgresql性能优化最佳综合案例实践

本文发布于:2024-03-09 04:43:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1723853.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:性能   案例   计划   crt   oracle

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!