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

pkg/storage/metastore: Optimize SQL query building of locations by ids #223

Merged
merged 2 commits into from
Oct 6, 2021

Conversation

brancz
Copy link
Member

@brancz brancz commented Oct 6, 2021

This often shows up in large queries of previously unqueried data.

name                               old time/op    new time/op    delta
BuildLocationsByIDsQuery/1-8          378ns ± 0%      89ns ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10-8        1.42µs ± 0%    0.17µs ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100-8       20.8µs ± 0%     0.9µs ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/1000-8      1.46ms ± 0%    0.02ms ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10000-8      129ms ± 0%       0ms ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100000-8     12.5s ± 0%      0.0s ± 0%   ~     (p=1.000 n=1+1)

name                               old alloc/op   new alloc/op   delta
BuildLocationsByIDsQuery/1-8           144B ± 0%      128B ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10-8          392B ± 0%      144B ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100-8       30.0kB ± 0%     0.4kB ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/1000-8      4.07MB ± 0%    0.00MB ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10000-8      517MB ± 0%       0MB ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100000-8    58.7GB ± 0%     0.0GB ± 0%   ~     (p=1.000 n=1+1)

name                               old allocs/op  new allocs/op  delta
BuildLocationsByIDsQuery/1-8           2.00 ± 0%      1.00 ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10-8          20.0 ± 0%       1.0 ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100-8          200 ± 0%         1 ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/1000-8       2.90k ± 0%     0.00k ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/10000-8      29.9k ± 0%      0.0k ± 0%   ~     (p=1.000 n=1+1)
BuildLocationsByIDsQuery/100000-8      301k ± 0%        0k ± 0%   ~     (p=1.000 n=1+1)

@brancz brancz changed the title Extract build locations by id query pkg/storage/metastore: Optimize SQL query building of locations by ids Oct 6, 2021
@brancz brancz merged commit 7f695d9 into main Oct 6, 2021
@brancz brancz deleted the extract-build-locations-by-id-query branch October 6, 2021 06:42
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.

1 participant