Re: contrib/pg_stat_statements
От | Alvaro Herrera |
---|---|
Тема | Re: contrib/pg_stat_statements |
Дата | |
Msg-id | 20081016012336.GK6012@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: contrib/pg_stat_statements (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>) |
Ответы |
Re: contrib/pg_stat_statements
|
Список | pgsql-hackers |
ITAGAKI Takahiro wrote: > We need to avoid using normal UPDATEs to increment counters > because it requires row-level exclusive locks and kills concurrency. > My idea was modifying heap tuples directly in pages: > > buffer = ReadBuffer(stats_rel, blknum); > LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE); > htup = PageGetItem(BufferGetPage(buffer), itemid); > statobj = ((char *) htup + htup->t_hoff); > statobj->calls++; > LockBuffer(buffer, BUFFER_LOCK_UNLOCK); > > It seemed to work in my test, but of course it is too dangerous. > (If we had supported ISAM-like storage engine, we might use it here.) heap_inplace_update? -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support
В списке pgsql-hackers по дате отправления: