Skip to content

Remove redundant index on taggings table

Patrick Bair requested to merge pb-remove-redundant-taggings-index into master

What does this MR do and why?

Remove a redundant index on taggings, index_taggings_on_taggable_id_and_taggable_type defined over (taggable_id, taggable_type). This table already has another index with the same leading columns index_taggings_on_taggable_id_and_taggable_type_and_context defined over (taggable_id, taggable_type, context).

We can get a nice savings from this:

gitlabhq_production=> \di+ index_taggings_on_taggable_id_and_taggable_type
                                             List of relations
 Schema |                      Name                       | Type  | Owner  |  Table   | Size  | Description
--------+-------------------------------------------------+-------+--------+----------+-------+-------------
 public | index_taggings_on_taggable_id_and_taggable_type | index | gitlab | taggings | 32 GB |

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Patrick Bair

Merge request reports