Re: Help with rewriting query

Поиск
Список
Период
Сортировка
От Tobias Brox
Тема Re: Help with rewriting query
Дата
Msg-id 20050611095909.GR8451@tobias.nordicbet.com
обсуждение исходный текст
Ответ на Re: Help with rewriting query  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-performance
[Kevin Grittner - Fri at 02:49:57PM -0500]
> If you add a column to the person table for "last_food_id" and triggers
> to maintain it when the food table is modified, voila!  You have a
> simple and fast way to get the results you want.

Reminds me about the way the precursor software of our product was made,
whenever it was needed to check the balance of a customer, it was needed to
scan the whole transaction table and sum up all transactions.  This
operation eventually took 3-4 seconds before we released the new software,
and the customers balance was supposed to show up at several web pages :-)

By now we have the updated balance both in the customer table and as
"post_balance" in the transaction table.  Sometimes redundancy is good.
Much easier to solve inconsistency problems as well :-)

--
Tobias Brox, +47-91700050

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: faster search
Следующее
От: Cosimo Streppone
Дата:
Сообщение: Re: faster search