3 ms·
> PostgreSQL also supports concurrent index creation I use this all the time, and am flabbergasted how people can do without it. I feel like migration framewo
by fdr 14y ago
> PostgreSQL also supports concurrent index creation
I use this all the time, and am flabbergasted how people can do without it. I feel like migration frameworks should make it the default with Postgres.
It's too bad it can't be mixed with transactional DDL, but because indexes are not logical changes, I don't really care as much, even if it is dissatisfying.
So, all in all, for those who want to take advantage of this feature in Postgres:
Stop doing this:
CREATE INDEX foo ...
Start doing this:
CREATE INDEX foo CONCURRENTLY ...
For the cost of one keyword, your index additions can be a non-event.
- fdr 14y agoTrue to forgettable SQL-ish (did you know that indexes are not addressed by the SQL standard?) syntax, I got it slightly wrong: $ psql fdr=> \h CREATE INDEX Command: CREATE INDEX Description: define a new index Syntax: CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ name ] ON table [ USING method ] ( { column | ( expression ) } [ COLLATE collation ] [ opclass ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ) [ WITH ( storage_parameter = value [, ... ] ) ] [ TABLESPACE tablespace ] [ WHERE predicate ] So, rather: CREATE INDEX CONCURRENTLY foo ....