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 text instead of string as it can be limiting for paths length #1215

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

digitaltom
Copy link
Member

No description provided.

@Adnilson
Copy link
Contributor

Adnilson commented Sep 9, 2024

Note: I tried to add this on trello but it did not format correctly.

Below I show some steps in order to see the problem related to the DB.

Altered the table by optimizing:

https://medium.com/@ashik.ck/how-to-re-index-mysql-database-after-restored-356788eeba62

No change

Used some variations of string (varchar)

1st mirror around 1m

  • varchar(255) -> 15s
  • varchar(2048), max limit URL -> 22s
  • varchar(4096), max linux file path -> 25-34s

When using text

1st mirror up to 6 minutes

  • text -> 40s

These are set on the rails migration file as :string, limit: [limit]

This is a InnoDB limitation:
https://dba.stackexchange.com/a/222182
https://cpanel.net/blog/products/varchar-vs-text-for-mysql-databases/
https://kb.stablepoint.com/docs/choosing-between-varchar-and-text-in-mysql

commands used:
bin/rmt-cli products enable sles/15.6/x86_64
bin/rmt-cli mirror product 2609,2626,2683,2618 # mirror SLE 15.6

Around 9GB

Total repositories -> 3358
Total downloaded_files -> 8375

@digitaltom
Copy link
Member Author

1st mirror around 1m

* varchar(255) -> 15s

* varchar(2048), max limit URL ->  22s

* varchar(4096), max linux file path -> 25-34s

Having paths longer than 255 chars is really an exception, that's why it was only reported now. I'd suggest to set the column to varchar(512), and test for the performance impact. If it's low impact (expected), then I'd change it to 512.

db/schema.rb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
@Adnilson Adnilson force-pushed the revert-1214-revert-1210-change_local_path_type branch from e9b74e1 to 1af565e Compare September 20, 2024 17:29
Copy link
Contributor

@ngetahun ngetahun left a comment

Choose a reason for hiding this comment

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

LGTM

@digitaltom
Copy link
Member Author

1st mirror around 1m

* varchar(255) -> 15s

* varchar(2048), max limit URL ->  22s

* varchar(4096), max linux file path -> 25-34s

Do we have a timing result for varchar(512) to compare?

@Adnilson
Copy link
Contributor

1st mirror around 1m

* varchar(255) -> 15s

* varchar(2048), max limit URL ->  22s

* varchar(4096), max linux file path -> 25-34s

Do we have a timing result for varchar(512) to compare?

@digitaltom :

It is basically the same time. Even 1 second less on average (from 13 to 12)

I tested this on a different network and in a docker container.

@Adnilson Adnilson merged commit 275b917 into master Nov 5, 2024
3 checks passed
@Adnilson Adnilson deleted the revert-1214-revert-1210-change_local_path_type branch November 5, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants