Re: update functions locking tables

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: update functions locking tables
Дата
Msg-id 20050830234704.GF77007@pervasive.com
обсуждение исходный текст
Ответ на Re: update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Ответы Re: update functions locking tables  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Список pgsql-general
On Tue, Aug 30, 2005 at 08:13:15AM -0300, Clodoaldo Pinto wrote:
> 2005/8/29, Michael Fuhr <mike@fuhr.org>:
> >
> > In general, writers shouldn't block readers.  Have you examined
> > pg_locks?  Do you know exactly what the blocked queries are, or can
> > you find out from pg_stat_activity (stats_command_string must be
> > enabled)?  Are you doing any explicit locking (LOCK statement)?
> >
>
> This is one of the blocked queries:
> select count (*) from times_producao where pontos_0 - pontos_7 > 0;

FWIW, that where clause might be more efficient as
WHERE pontos_0 > pontos_7. Some databases would be able to use indexes
to answer that (not sure if PostgreSQL could), plus it removes an
operator. It also seems to be cleaner code to me. :)
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software        http://pervasive.com        512-569-9461

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

Предыдущее
От: Guy Doune
Дата:
Сообщение: Get postgresql workin in french...
Следующее
От: Clodoaldo Pinto
Дата:
Сообщение: Re: update functions locking tables