Created
December 16, 2011 09:10
-
-
Save jackdouglas/1485246 to your computer and use it in GitHub Desktop.
Performance hit of a check constraint in Postgres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin; | |
set role dba; | |
create role stack; | |
grant stack to dba; | |
create schema authorization stack; | |
set role stack; | |
-- | |
create table foo(id integer check (id>0)); | |
create table bar(id integer); | |
\timing on | |
insert into foo(id) select generate_series(1, 1000000); | |
insert into bar(id) select generate_series(1, 1000000); | |
\timing off | |
-- | |
rollback; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment