While for some other tables (links etc, maybe?) there may be a need for the _namespace field to allow < 0, the page table has no reason to do so.
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Schema::Updating page_namespace field to unsigned | mediawiki/core | master | +212 -4 |
Related Objects
Related Objects
Event Timeline
Comment Actions
Does this has performance impact on joins with this field if the datatypes are not the same?
Comment Actions
Change 786288 had a related patch set uploaded (by Diesel kapasule; author: Diesel kapasule):
[mediawiki/core@master] Schema::Updating page_namespace field to unsigned
Comment Actions
I think that’s a legitimate concern; I tried the alter locally, and the EXPLAIN for a randomly cobbled together query changed:
before
mysql> EXPLAIN SELECT page_id FROM page JOIN logging ON log_namespace = page_namespace AND log_title = page_title WHERE log_type = 'delete'; +----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+-----------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+-----------------------+ | 1 | SIMPLE | logging | NULL | ref | log_type_action,log_type_time,log_page_time | log_type_action | 34 | const | 162 | 100.00 | Using index condition | | 1 | SIMPLE | page | NULL | eq_ref | page_name_title | page_name_title | 261 | wiki1.logging.log_namespace,wiki1.logging.log_title | 1 | 100.00 | Using index | +----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+-----------------------+
after
+----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+--------------------------+ | 1 | SIMPLE | logging | NULL | ref | log_type_action,log_type_time,log_page_time | log_type_action | 34 | const | 162 | 100.00 | Using index condition | | 1 | SIMPLE | page | NULL | eq_ref | page_name_title | page_name_title | 261 | wiki1.logging.log_namespace,wiki1.logging.log_title | 1 | 100.00 | Using where; Using index | +----+-------------+---------+------------+--------+---------------------------------------------+-----------------+---------+-----------------------------------------------------+------+----------+--------------------------+ 2 rows in set, 1 warning (0.00 sec)
That “using where” under extra is worrying.