Hi all,
I noticed that homebox_users lacks any indexes. This maybe a problem down the road and indexing (uid,name) as a PK seems like a fairly good choice unless I'm missing something.
MariaDB [drupal_redesign]> desc homebox_users;
+----------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| uid | int(10) unsigned | NO | | 0 | |
| name | varchar(64) | NO | | | |
| settings | longtext | NO | | NULL | |
+----------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
I'd put UID first in the index, as name is likely to have a very low cardinality on most sites. Especially as you will only be able to index a prefix of the column. This should be a considerable performance improvement for larger sites and makes it a less dangerous table (as with longtext in the table, if an order by/group by ever hits the table its going to go directly to a temp table on disk and not be able to enter a HEAP table).
I can understand that this may have been done due to this being a very volatile table, to avoid the index overhead. However, with InnoDB you will always have a PK index so all you get by not defining one is the assurance it will be entirely useless to a select.
Comment | File | Size | Author |
---|---|---|---|
#3 | homebox.patch | 1.06 KB | drumm |
Comments
Comment #1
drummtag
Comment #2
mstef CreditAttribution: mstef commentedChanging version
Comment #3
drummStraightforward patch attached.
Comment #4
drummComment #5
mstef CreditAttribution: mstef commentedNice work
Comment #6
mstef CreditAttribution: mstef commentedCommitted