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

creating a view without specifying collation explicitly should insert the collation of the underlying entity

    • Query Optimization

      Currently when collation is not explicitly specified in the createView command, we create the view with default collation (if it's on top of a collection) or error (if it's on top of a view).

      Neither of these is very user friendly - when creating a view on top of a view, you should not need to explicitly specify identical collation to allow view definition to succeed - it should do the "logical" thing if collation is omitted - the only allowed behavior, which is to insert identical collation from the underlying view.

      For view on a collection, I would argue that the default behavior should be the same - if explicit collation is not specified, it is extremely unlikely (nearly impossible) that what the user wants is "simple" collation, if the underlying collection has some other collation explicitly defined.

      Therefore explicitly inserting collation of the underlying entity is the correct behavior.

      I would suggest that already created views should of course retain their currently present behavior/attribute/collations, i.e. they will replicate exactly as they are, but newly created views will cause an explicit collation to be inserted in the entry for creating this view.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            2 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: