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

v1/viz: Stop returning the db_size_in_bytes value #15678

Merged
merged 1 commit into from
May 25, 2020

Conversation

Algunenano
Copy link
Contributor

Changes v1/viz requests to stop calculating (and returning) the db_size_in_bytes value, which requires a really expensive cartodb.CDB_UserDataSize call.

I'm not sure if anybody is using this value from this exact call, but that would be a bad dependency that should call the appropriate endpoint, not a random viz list. I think we could remove way more information that is currently output by the API, but I've limited the change to the one that causes performance issues.

Example of old owner output:

{"id":"f80dfdef-ea5c-498d-b98a-82362650d944","name":null,"last_name":null,"username":"dev2","email":"rmrodriguez+dev@cartodb.com","avatar_url":"/assets/unversioned/images/avatars/avatar_pacman_yellow.png","website":null,"description":null,"location":null,"twitter_username":null,"disqus_shortname":null,"available_for_hire":false,"base_url":"http://localhost:3000/user/dev2","google_maps_query_string":null,"quota_in_bytes":99999999999999999,"table_count":3396,"viewer":false,"role_display":"builder","org_admin":false,"public_visualization_count":3,"all_visualization_count":11,"org_user":false,"remove_logo":false,"db_size_in_bytes":3194740736}

After the change the db_size_in_bytes is gone:

{"id":"f80dfdef-ea5c-498d-b98a-82362650d944","name":null,"last_name":null,"username":"dev2","email":"rmrodriguez+dev@cartodb.com","avatar_url":"/assets/unversioned/images/avatars/avatar_pacman_yellow.png","website":null,"description":null,"location":null,"twitter_username":null,"disqus_shortname":null,"available_for_hire":false,"base_url":"http://localhost:3000/user/dev2","google_maps_query_string":null,"quota_in_bytes":99999999999999999,"table_count":3396,"viewer":false,"role_display":"builder","org_admin":false,"public_visualization_count":3,"all_visualization_count":11,"org_user":false,"remove_logo":false}

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

LGTM! I can't think of any possible usage of that size from this endpoint... @alrocar @VictorVelarde any idea?

@Algunenano Algunenano merged commit 00298f0 into master May 25, 2020
@Algunenano Algunenano deleted the limit_db_size_fetches branch May 25, 2020 15:08
@VictorVelarde
Copy link
Contributor

Sorry for being late on this. I don't know about any direct use of db_size_in_bytes from v1/viz.

What I can tell you is that there is a similar field returned by /api/v3/me and I'm not sure if that should be affected also by this change. We used to consume the second from the Profile page, to display some visual indicators on % used and available, but not anymore

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

Successfully merging this pull request may close these issues.

3 participants