Page MenuHomePhabricator

Change data type of namespace fields from int to smallint or mediumint
Open, Needs TriagePublic

Description

Maximum namespace value I'm finding in production is around 3000. Smallint works up to 32K and Mediumint up to 8.3M. While, the saved space would be negligible in page table. I care more about tl_from_namespace field and similar in links tables. It can save up to tens of gigabytes from each commons database without issues. According to https://www.mediawiki.org/wiki/Extension_default_namespaces, the only extension using above 32K value for namespace is https://www.mediawiki.org/wiki/Extension:WSSpaces It might be quite hard to change that to values below 32K so mediumint would be the good first step?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I tried to use mediumint but doctrine gives:

Unknown column type "mediumint" requested.

I see it here: https://github.com/doctrine/dbal/blob/4933e8482b81f111c30a7e1ca0fea24fb2aa25a5/src/Platforms/AbstractMySQLPlatform.php#L747 but I guess since it's not fully supported, probably not allowed.

I think we can go to smallint. We should just talk to WSSpaces and make sure they can change the namespace entries beforehand.

I think we can go to smallint. We should just talk to WSSpaces and make sure they can change the namespace entries beforehand.

cf: T180885: Create maintenance script to renumber namespaces

I guess we should update the sqoop jobs accordingly.
But maybe they will continue to work without changes if they accept the smallint as a valid entry already?
Should we check?

I think you are right, but someone needs to check. Hive has int and bigint (long) but I don't think it has smaller types. We should just be sure that e.g. mediumint will automatically map and ingest to the int fields in Hive.