Re: Xlogprefetcher: Use atomic add for increment counter
| От | Andres Freund |
|---|---|
| Тема | Re: Xlogprefetcher: Use atomic add for increment counter |
| Дата | |
| Msg-id | uz46clo7ukuozkux5bw3oxzt4bnvembglyrqg7l55wmqdrlmij@g2iz3mr6c32a обсуждение исходный текст |
| Ответ на | Re: Xlogprefetcher: Use atomic add for increment counter (Ranier Vilela <ranier.vf@gmail.com>) |
| Ответы |
Re: Xlogprefetcher: Use atomic add for increment counter
|
| Список | pgsql-hackers |
On 2025-11-07 11:52:37 -0300, Ranier Vilela wrote: > Em sex., 7 de nov. de 2025 às 11:41, Andres Freund <andres@anarazel.de> > escreveu: > > On 2025-11-07 11:28:06 -0300, Ranier Vilela wrote: > > > Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 and > > > pg_atomic_write_u64 calls. > > > > > > This simplifies the logic and this increases the likelihood that the > > > operation will be successful. > > > > How does it do so? As the assertions indicate, this can only be run from a > > single process. > > > Can I rephrase that? > > That simplifies the logic a bit. Maybe simpler, but also vastly slower than before. An atomic increment is maybe two orders of magnitude more expensive than an unlocked read & write.
В списке pgsql-hackers по дате отправления: