Cache invalidation notification (was: Database Caching)
От | Hannu Krosing |
---|---|
Тема | Cache invalidation notification (was: Database Caching) |
Дата | |
Msg-id | 1015314331.1933.25.camel@taru.tm.ee обсуждение исходный текст |
Ответ на | Re: Database Caching (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Mon, 2002-03-04 at 23:50, Tom Lane wrote: > "Rod Taylor" <rbt@zort.ca> writes: > > Rather than result caching, I'd much rather see an asynchronous NOTICE > > telling my webservers which have RULES firing them off when a table is > > modified. > > LISTEN/NOTIFY? But is there an easy way to see which tables affect the query result, something like machine-readable EXPLAIN ? Another thing that I have thought about Is adding a parameter to notify, so that you can be told _what_ is changed (there is big difference between being told that "somebody called" and "Bob called") There are two ways of doing it 1) the "wire protocol compatible" way , where the argument to LISTEN is interpreted as a regular expression (or LIKE expression), so that you can do LISTEN 'ITEM_INVALID:%'; and the receive all notifies for NOTIFY 'ITEM_INVALID:' || ITEM_ID; and NOTIFY 'ITEM_INVALID:ALL'; where the notify comes in as one string 2) the more general way where you listen on exact "relation" and notify has an argument at both syntax and protocol level, i.e LISTEN ITEM_INVALID; and NOTIFY 'ITEM_INVALID',ITEM_ID; NOTIFY 'ITEM_INVALID','ALL'; ------------------ Hannu
В списке pgsql-hackers по дате отправления: