Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26589

make the mongodb support invisible index

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.4.0-rc0
    • Fix Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None

      Description

      I'd mongodb support the invisible index. the invisible index is still maintained like other index, but the optimizer would ignore it.

      Basic api:

      db.runCommand( { collMod: "sessions",
                       index: { keyPattern: { lastAccess: 1 },
                                invisible: true
                              }
      })
       
       
      db.runCommand( { collMod: "sessions",
                       index: { keyPattern: { lastAccess: 1 },
                                invisible: false
                              }
      })
      

      *Why this is needed*

      Most developer like freedom, they may not request DBA to review their queries and they feel free to create many indexes and Then database runs with many unnecessary indexes. However, it is hard for DBA to make sure which index is really unnecessary. Sometimes, even PD is not sure about that also. like the main developer has left company and so on or lack of document and so on. So no one can make decision to drop these indexes since the rollback may take a very long time. these index is there for impacting DML and make the optimizer harder sometime.

      If we have the invisible index, DBA can make the index invisible first, and watch for 2 weeks. if we knows any query still need it, we can simply make it invisible false. if no query impacts, we can drop it confidently.

      If you are ok with this requirement and are lacking of resource to work on this, I'd like to work on this.

      looking forward your feedback.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.storch David Storch
              Reporter:
              zhihuifan fan zhihui
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: