Opened 12 years ago

Closed 11 years ago

#7436 closed enhancement (fixed)

Unneccesary INDEX on recgrouppassword table

Reported by: benlanc@… Owned by: sphery
Priority: trivial Milestone: 0.23
Component: MythTV - General Version: 0.22rc1
Severity: low Keywords: database schema
Cc: Ticket locked: no


The database table recgrouppassword has a duplicate index defined (found in DBSchemaVer 1244).

Drop with:

ALTER TABLE `recgrouppassword` DROP INDEX `recgroup`;

Change History (3)

comment:1 Changed 12 years ago by sphery

Owner: changed from Isaac Richards to sphery
Status: newaccepted

comment:2 Changed 11 years ago by Stuart Auchterlonie

Milestone: unknown0.23

comment:3 Changed 11 years ago by sphery

Resolution: fixed
Status: acceptedclosed

(In [23202]) Fixes #7436. Remove a couple of duplicate indices.

The recgroup index on the recgrouppassword table was added in [3112] when a named index identical to the primary key index was created during table creation, likely just an oversight. This duplicate index should exist in all valid mythconverg schemas, and would only be missing if users edited their schemas (which they should never do).

The title_2 index on the videometadata table was added in [2635] as a quick solution to fixing a broken DB upgrade path. This duplicate index is likely to exist on most mythconverg schemas, but it is possible that it won't exist in some valid mythconverg schemas (that were created long ago) due to the broken DB upgrade path fixed by [2635].

Though neither index caused any harm, they're being removed only for cleanliness of the schema design. There are no functional changes due to this update. In all, the end result is that the removal of the recgroup index may save up to 1 kiB and the removal of the title_2 index may save up to 10's of kiB of storage space on the hard drive.

Checking to see if the index exists before removing it simply prevents logging errors that aren't errors and, even if there is an error removing the index, the error is ignored (as the extra indices don't cause any harm) and the schema update is considered complete and successful.

Note: See TracTickets for help on using tickets.