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

[Merged by Bors] - sql: add coinbase index to atxs table #5585

Closed

Conversation

kacpersaw
Copy link
Contributor

Description

Added index by coinbase to atxs table as the number of atxs grew significantly and we can expect that it will be frequently queried from API.

@kacpersaw kacpersaw linked an issue Feb 19, 2024 that may be closed by this pull request
Copy link
Contributor

@dshulyak dshulyak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you doublecheck how fast are new atxs queries, with and without this index, before merging?

to make api read from disk you could drop kernel caches with:

echo 3 > /proc/sys/vm/drop_caches

@kacpersaw
Copy link
Contributor Author

kacpersaw commented Feb 19, 2024

@dshulyak it's better than before. Checked on macOS M1

With index

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T14:15:19+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:57557", "grpc.code": "OK", "grpc.time_ms": 6906.889}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T14:18:37+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:58591", "grpc.code": "OK", "grpc.time_ms": 7242.017}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T15:09:51+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:61473", "grpc.code": "OK", "grpc.time_ms": 7406.61}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T15:10:27+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:61530", "grpc.code": "OK", "grpc.time_ms": 7715.156}

Without index

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T14:16:13+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:57823", "grpc.code": "OK", "grpc.time_ms": 10101.229}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T14:17:12+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:58145", "grpc.code": "OK", "grpc.time_ms": 9029.339}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T15:11:00+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:61557", "grpc.code": "OK", "grpc.time_ms": 9657.68}

INFO	grpc	finished unary call with code OK	{"grpc.start_time": "2024-02-19T15:11:22+01:00", "system": "grpc", "span.kind": "server", "grpc.service": "spacemesh.v2alpha1.ActivationService", "grpc.method": "List", "peer.address": "127.0.0.1:61578", "grpc.code": "OK", "grpc.time_ms": 9886.525}

@kacpersaw
Copy link
Contributor Author

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Feb 19, 2024
@spacemesh-bors
Copy link

Build failed:

  • systest-status

@dshulyak dshulyak changed the title Add coinbase index to atxs table sql: add coinbase index to atxs table Feb 20, 2024
@kacpersaw
Copy link
Contributor Author

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Feb 20, 2024
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title sql: add coinbase index to atxs table [Merged by Bors] - sql: add coinbase index to atxs table Feb 20, 2024
@spacemesh-bors spacemesh-bors bot closed this Feb 20, 2024
@spacemesh-bors spacemesh-bors bot deleted the 5581-consider-adding-index-by-coinbase-for-atxs branch February 20, 2024 13:44
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

Successfully merging this pull request may close these issues.

consider adding index by coinbase for atxs
2 participants