Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spinlock to protect all entries #2

Open
Jan-M opened this issue May 28, 2020 · 0 comments
Open

Use spinlock to protect all entries #2

Jan-M opened this issue May 28, 2020 · 0 comments

Comments

@Jan-M
Copy link
Collaborator

Jan-M commented May 28, 2020

Judging by not using atomic vars/ops for increment we would similar to pgss need spin locks on all entries.

https://github.com/postgres/postgres/blob/master/contrib/pg_stat_statements/pg_stat_statements.c#L1386

Essentially they seem to do it more sane:

shared LWLock if one starts dealing with hashmap and entry
exclusve LWLock for adding entry to hash map only
spinlock on modify entry

Although this needs testing given the impact seen in pgbench

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant