Hi all,
I’ve just noticed that some DDL statements will block if there are other
queries accessing the relation in question, even where those queries are not
dependant on the underlying structures (such as a new index, created after
the initial query).
For instance…
> SELECT long_running_query FROM foo; -- Query A,
>
> -- meanwhile…
>
> CREATE UNIQUE INDEX ON foo USING btree (blah);
> -- Fine, no problem
>
> DROP INDEX foo_blah_idx;
> -- The above DDL statement will block until Query A completes, even though the
> query cannot possibly rely on the newly created index
>
Is this behaviour by design? Is it worth allowing DDL statements to occur
where it can be determined that no currently running query will be affected?
Cheers,
Tim