Re: tune postgres for UPDATE

Поиск
Список
Период
Сортировка
От Filip Rembiałkowski
Тема Re: tune postgres for UPDATE
Дата
Msg-id 92869e660812080609s193fb253oc2ec28ffc0ed9022@mail.gmail.com
обсуждение исходный текст
Ответ на Re: tune postgres for UPDATE  ("Grzegorz Jaśkiewicz" <gryzman@gmail.com>)
Список pgsql-general


2008/12/8 Grzegorz Jaśkiewicz <gryzman@gmail.com>
try rewriting it to something like:

update users set price = p.price from prices p where p.type =
'normal_price' and p.currency = users.currency;

also avoid "fake" updates:

update users set price = p.price from prices p where p.type =
'normal_price' and p.currency = users.currency
and users.price is distinct from p.price;



If price change is a frequent operation, rethink the design
- maybe you could keep a pointer to "pricing group" instead of keeping separate price for every user.




--
Filip Rembiałkowski

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

Предыдущее
От: Liraz Siri
Дата:
Сообщение: TurnKey PostgreSQL: new installable live CD optimized for easy of use
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: tune postgres for UPDATE