Re: Is it possible to speed up addition of "not null"?

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Is it possible to speed up addition of "not null"?
Дата
Msg-id 20120202151135.GC388@crankycanuck.ca
обсуждение исходный текст
Ответ на Re: Is it possible to speed up addition of "not null"?  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
On Thu, Feb 02, 2012 at 02:20:59PM +0100, hubert depesz lubaczewski wrote>
> Sure. But at least theoretically, it could use index - for example, if
> I had index "where column is null".

To build that index, you had to visit every row too.  But I see what
your problem is.

> But this should be nearly instantenous. This machine is very busy. In
> the low-traffic moments we have ~ 5k transactions per second.

[. . .]

> This table is concurrently used. Taking it offline is not an option.

It's this.  You don't have low enough traffic to get the lock you need
on the table.  You're changing the schema of the table, and you need
to lock it while you do that.  Probably you're not getting the lock
you need granted and therefore it seems like it's taking a long time.

A

--
Andrew Sullivan
ajs@crankycanuck.ca

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue
Следующее
От:
Дата:
Сообщение: 9.0 EXPLAIN Buffers: written=nnnn