Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15803

Rename "cardinality" term for shard key considerations

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • manual, Server

    Description

      I was reviewing the design document for an upcoming project "Add and expose metrics to make shard key selection easier", when I noticed we use the term "cardinality" to mean "number of unique values":
      https://www.mongodb.com/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-range

      This is mostly fine, and somewhat consistent with set theory (as in the wiki page), but are the shard key values a set? I would think they are more like a multi-set or vector, since values repeat.

      We are underway in making a new query optimizer which will estimate the "cardinality" of different query plan sub-segments. In that context, the "cardinality" will mean "number of values", not "number of unique values". This is all going to get confusing I think.

      I'm open to suggestions here but I would propose the "choose a shard key" page would use "number of distinct values" instead of cardinality.

      Attachments

        Activity

          People

            joseph.dougherty@mongodb.com Joseph Dougherty
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 1 week ago