Skip to content

Commit 450571a

Browse files
committed
Make both net tables UNLOGGED
Their contents shouldn't survive a crash, and UNLOGGED makes the INSERTs/DELETEs faster and consume less CPU.
1 parent 572c289 commit 450571a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sql/pg_net--0.4--0.5.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ alter table net._http_response drop constraint _http_response_pkey;
44
drop trigger ensure_worker_is_up on net.http_request_queue;
55
alter function net._check_worker_is_up() rename to check_worker_is_up;
66
drop index net._http_response_created_idx;
7+
alter table net.http_request_queue set unlogged;
8+
alter table net._http_response set unlogged;

sql/pg_net.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ check (
88

99
-- Store pending requests. The background worker reads from here
1010
-- API: Private
11-
create table net.http_request_queue(
11+
create unlogged table net.http_request_queue(
1212
id bigserial,
1313
method net.http_method not null,
1414
url text not null,
@@ -31,7 +31,7 @@ $$ language plpgsql;
3131

3232
-- Associates a response with a request
3333
-- API: Private
34-
create table net._http_response(
34+
create unlogged table net._http_response(
3535
id bigint,
3636
status_code integer,
3737
content_type text,

0 commit comments

Comments
 (0)