Re: SELECT is immediate but the UPDATE takes forever

Поиск
Список
Период
Сортировка
От Michał Roszka
Тема Re: SELECT is immediate but the UPDATE takes forever
Дата
Msg-id 20101207154537.81utnyfeo00cwgwg@horde.iq.pl
обсуждение исходный текст
Ответ на SELECT is immediate but the UPDATE takes forever  (Raimon Fernandez <coder@montx.com>)
Ответы Re: SELECT is immediate but the UPDATE takes forever  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Re: SELECT is immediate but the UPDATE takes forever  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: SELECT is immediate but the UPDATE takes forever  (Raimon Fernandez <coder@montx.com>)
Список pgsql-general
Quoting Raimon Fernandez <coder@montx.com>:

> I want to understand why one of my postgresql functions takes an
> eternity to finish.
>
> Here's an example:
>
> UPDATE comptes SET belongs_to_compte_id=42009 WHERE (codi_compte LIKE
> '10000%' AND empresa_id=2 AND nivell=11); // takes forever to finish

[...]

> but the same SELECT count, it's immediate:
>
> SELECT count(id) FROM comptes WHERE codi_compte LIKE '10000%' AND
> empresa_id=2 AND nivell=11;

Maybe there is any check or constraint on belongs_to_compte_id.comptes that
might take longer?

Cheers,

    -Mike

--
Michał Roszka
mike@if-then-else.pl


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

Предыдущее
От: Raimon Fernandez
Дата:
Сообщение: SELECT is immediate but the UPDATE takes forever
Следующее
От: Steve Clark
Дата:
Сообщение: dotted quad netmask conversion