fklock-test-forshare.sql

text/plain

Filename: fklock-test-forshare.sql
Type: text/plain
Part: 1
Message: Re: foreign key locks, 2nd attempt
\timing on
-- Use a regular, logged table: additional xlog activity might matter.
CREATE TABLE test_forshare AS SELECT * FROM generate_series(1,1000000);

-- master times: 6067.286, 6396.099, 6191.118
-- patched times: 6627.589, 6625.652, 6467.544
SELECT count(*) FROM (SELECT * FROM test_forshare FOR SHARE) t;

DROP TABLE test_forshare;