Skip to content

buffer_content when i test concurrent update  #4

@digoal

Description

@digoal

image

create table a (id int primary key, info text, crt_time timestamp) using undam;  

create or replace function upserta(int) returns void as $$  
declare  
begin  
  update a set info=random()::text,crt_time=now() where id=$1;  
  if not found then  
    insert into a values ($1,random()::text,now());  
  end if;  
exception when others then  
    update a set info=random()::text,crt_time=now() where id=$1;  
end;  
$$ language plpgsql strict;  
  
vi test.sql  
\set id random(1,10000000)  
select upserta(:id);  
  
pgbench -M prepared -n -r -P 1 -f ./test.sql -c 32 -j 32 -T 1200  

some time passed, qps down to zero.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions