Re: Postgresql Caching

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Postgresql Caching
Дата
Msg-id b42b73150610160700o36f25ca0p18d623e8ae0e9e5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgresql Caching  (mark@mark.mielke.cc)
Список pgsql-hackers
On 10/15/06, mark@mark.mielke.cc <mark@mark.mielke.cc> wrote:
> Using memcache, I've had problems with consistency brought right to
> the front. Both of these have failed me:
>
>     1) When updating a PostgreSQL record, I invalidate the memcache record.
>        If another process comes along in parallel before I commit, notices
>        that the memcache record is invalidated, it queries the data from
>        SQL, and updates the memcache record back to the old value. :-(
>
>     2) When updating a PostgreSQL record, I updated the memcache record
>        to the new value. If another process comes along in parallel before
>        I commit, that is still looking at an older view, cross-referencing
>        may not work as expected.
>
> I'm currently settled on 2), but setting a short timeout (5 seconds) on
> the data. Still an imperfect compromise between speed and accuracy, but
> it isn't causing me problems... yet.

use advisory locks for 'race sensitive' data. (or user locks in <
8.2).  or, just use tables, becuase you need mvcc, not performance :)

merlin


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

Предыдущее
От: "Marko Kreen"
Дата:
Сообщение: Re: Getting the type Oid in a CREATE TYPE output function
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: [BUGS] BUG #2683: spi_exec_query in plperl returns